diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-11-13 17:53:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-11-13 18:04:26 +0100 |
commit | 12fa9ece663f24eff44197befe546a92e6c90724 (patch) | |
tree | a09c9b7844a5c8298d81c9b4934acc36f9c8b28b /vcl/ios | |
parent | 4be8c3205afd55fa7e1f578384d3c91ebd8b5ec3 (diff) |
Avoid global static data
...that (indirectly) allocates memory via rtl/alloc.h, thereby causing the
rtl_cache_wsupdate_init thread to be spawned before main, as on Mac OS X that
would interfere with the code in sal_detail_initialize to close all file
descriptors >= 3 -- on Mac OS X the pthreads implementation makes use of KQUEUE
file descriptors.
* This commit removes enough global static data to make ui-preview work again on
Mac OS X (where it crashed at startup when the main thread closed the KQUEUE fd
used by pthreads implementation threads). gengal uses further static data (at
least from module sb), so needs further clean-up.
* Avoiding global static instances derived from class Application required the
introduction of vcl/vclmain.hxx.
* That the vcl library was linked against the static vclmain library (which only
provides an implementation of main) appears to me to be a historic relic (all
executables should either include a SAL_IMPLEMENT_MAIN or link against vclmain),
so I removed that.
Change-Id: I048aa616208cb3a1b9bd8dcc3b729ba1665729bd
Diffstat (limited to 'vcl/ios')
-rw-r--r-- | vcl/ios/source/dtrans/iOSTransferable.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/vcl/ios/source/dtrans/iOSTransferable.cxx b/vcl/ios/source/dtrans/iOSTransferable.cxx index 603b6b949f0d..1f335403d1ff 100644 --- a/vcl/ios/source/dtrans/iOSTransferable.cxx +++ b/vcl/ios/source/dtrans/iOSTransferable.cxx @@ -32,16 +32,13 @@ using namespace com::sun::star::container; using ::rtl::OUString; -const Type CPPUTYPE_SEQINT8 = getCppuType((Sequence<sal_Int8>*)0); -const Type CPPUTYPE_OUSTRING = getCppuType((OUString*)0); - namespace // private { bool isValidFlavor( const DataFlavor& aFlavor ) { size_t len = aFlavor.MimeType.getLength(); Type dtype = aFlavor.DataType; - return ((len > 0) && ((dtype == CPPUTYPE_SEQINT8) || (dtype == CPPUTYPE_OUSTRING))); + return ((len > 0) && ((dtype == getCppuType((Sequence<sal_Int8>*)0)) || (dtype == getCppuType((OUString*)0)))); } } // namespace private @@ -82,7 +79,7 @@ Any SAL_CALL iOSTransferable::getTransferData( const DataFlavor& aFlavor ) bool iOSTransferable::isUnicodeText(const DataFlavor& flavor) { - return (flavor.DataType == CPPUTYPE_OUSTRING); + return (flavor.DataType == getCppuType((OUString*)0)); } |