diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-13 22:35:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-14 15:59:06 +0100 |
commit | f5af2104fc490b90510e36bbf1d2adec8017c594 (patch) | |
tree | 1d9dffcfb65a00d908a346af912f0803d07e6383 /vcl/osx/salinst.cxx | |
parent | def3a581639840d39466327b4853c043bd662437 (diff) |
Fix and clean up SalAbort implementations on macOS and Windows
Since "forever", SalAbort has been declared as non-exported in
vcl/inc/salinst.hxx and (only) called from Application::Abort
(vcl/source/app/svapp.cxx) in Library_vcl. Its various implementations for
different platforms have always been scattered across Library_vcl.
For Windows, SalAbort was originally implemented in vcl/win/app/salinst.cxx,
until 1698debed2993fc5f262aa3ebbdb32fc112ac556 "Implement Windows VCL backend as
plugin" introduced an incompatible implementation in vcl/win/app/salplug.cxx
(which was added to Library_vcl) and moved the original implementation in
vcl/win/app/salinst.cxx from Library_vcl to Library_vclplug_win, where it thus
became dead code (and where it now gets removed).
For macOS, SalAbort was originally implemented in vcl/osx/salinst.cxx, until
3af4e1a0825c5b11ae4ef58fc411378aab669387 "Implement MacOSX VCL backend as
plugin" introduced a different implementation in vcl/osx/salplug.cxx (which was
added to Library_vcl) and moved the original implementation in
vcl/osx/salinst.cxx from Library_vcl to Library_vclplug_win, where it thus
became dead code (and where it now gets removed).
(In 0f3be2e19fa408d7069d586ccf04cb3f3eccd6b9 "Unify sal plugin loaders", the---
identical---new implementations in vcl/osx/salinst.cxx and
vcl/win/app/salinst.cxx where then consolidated with other---also identical---
implementations in vcl/source/app/salplug.cxx.)
For macOS, the original, now removed implementation in vcl/osx/salinst.cxx and
the consolidated implementation in vcl/source/app/salplug.cxx only differed in
an added
CrashReporter::addKeyValue("AbortMessage", rErrorText, CrashReporter::Write);
which is presumably harmless to add.
But for Windows, the original, now removed implementation in
vcl/win/app/salinst.cxx differed substantially from the consolidated
implementation in vcl/source/app/salplug.cxx, which is updated here to reflect
those differences. The one thing that cannot easily be updated, though, is the
//TODO: ImplFreeSalGDI();
call, as ImplFreeSalGDI is defined in Library_vclplug_win. I'll thus leave
fixing that TODO for another commit (if calling ImplFreeSalGDI from SalAbort is
even necessary, given that it ends in FatalAppExitW anyway)---my gut feeling is
that the whole 1698debed2993fc5f262aa3ebbdb32fc112ac556 "Implement Windows VCL
backend as plugin" was somewhat misguided.
Change-Id: I641a3d7b1bc27ae14c38eb1ec0838bc04e4290d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107666
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/osx/salinst.cxx')
-rw-r--r-- | vcl/osx/salinst.cxx | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index 91b22e9b77ec..bbe6d9d704f7 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -186,19 +186,6 @@ void AquaSalInstance::AfterAppInit() #endif } -void SalAbort( const OUString& rErrorText, bool bDumpCore ) -{ - if( rErrorText.isEmpty() ) - fprintf( stderr, "Application Error " ); - else - fprintf( stderr, "%s ", - OUStringToOString( rErrorText, osl_getThreadTextEncoding() ).getStr() ); - if( bDumpCore ) - abort(); - else - _exit(1); -} - SalYieldMutex::SalYieldMutex() : m_aCodeBlock( nullptr ) { |