X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ced3df773028534651ef358ae692affdbf3f9aaf..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/gtk/gnome/gvfs.cpp diff --git a/src/gtk/gnome/gvfs.cpp b/src/gtk/gnome/gvfs.cpp index 0651c72f82..aa96cc629f 100644 --- a/src/gtk/gnome/gvfs.cpp +++ b/src/gtk/gnome/gvfs.cpp @@ -41,9 +41,9 @@ class wxGnomeVFSLibrary public: wxGnomeVFSLibrary(); ~wxGnomeVFSLibrary(); + bool IsOk(); private: - bool IsOk(); bool InitializeMethods(); wxDynamicLibrary m_libGnomeVFS; @@ -56,8 +56,8 @@ private: public: wxDL_METHOD_DEFINE( gboolean, gnome_vfs_init, (), (), FALSE ) - wxDL_METHOD_DEFINE( void, gnome_vfs_shutdown, - (), (), /**/ ) + wxDL_VOIDMETHOD_DEFINE( gnome_vfs_shutdown, + (), () ) wxDL_METHOD_DEFINE( GnomeVFSResult, gnome_vfs_mime_set_icon, (const char *mime_type, const char *filename), (mime_type, filename), GNOME_VFS_OK ) @@ -73,6 +73,12 @@ wxGnomeVFSLibrary::wxGnomeVFSLibrary() wxGnomeVFSLibrary::~wxGnomeVFSLibrary() { + // we crash on exit later (i.e. after main() finishes) if we unload this + // library, apparently it inserts some hooks in other libraries to which we + // link implicitly (GTK+ itself?) which are not uninstalled when it's + // unloaded resulting in this crash, so just leave it in memory -- it's a + // lesser evil + m_libGnomeVFS.Detach(); } bool wxGnomeVFSLibrary::IsOk() @@ -82,8 +88,8 @@ bool wxGnomeVFSLibrary::IsOk() bool wxGnomeVFSLibrary::InitializeMethods() { - wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_init ) - wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_shutdown ) + wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_init ); + wxDL_METHOD_LOAD( m_libGnomeVFS, gnome_vfs_shutdown ); return true; }