From d4ee31ed63dd2ea99886ac10659e87d0ee042ea3 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 9 Jun 2014 17:40:06 +0200 Subject: [PATCH] Destroy context when unloading plugins. --HG-- branch : gsoc2014-dfighter --- code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp | 3 +++ code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp | 3 +++ .../src/plugins/georges_editor/georges_editor_plugin.cpp | 3 +++ code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp | 3 +++ .../src/plugins/landscape_editor/landscape_editor_plugin.cpp | 3 +++ code/studio/src/plugins/log/log_plugin.cpp | 3 +++ .../src/plugins/mission_compiler/mission_compiler_plugin.cpp | 3 +++ code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp | 3 +++ .../src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp | 3 +++ code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp | 3 +++ .../plugins/translation_manager/translation_manager_plugin.cpp | 3 +++ code/studio/src/plugins/world_editor/world_editor_plugin.cpp | 3 +++ 12 files changed, 36 insertions(+) diff --git a/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp b/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp index e4bf7f594..509dd2997 100644 --- a/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp +++ b/code/studio/src/plugins/bnp_manager/bnp_manager_plugin.cpp @@ -44,6 +44,9 @@ namespace BNPManager } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool BNPManagerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp b/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp index 77e254081..46a8ee6bd 100644 --- a/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp +++ b/code/studio/src/plugins/disp_sheet_id/disp_sheet_id_plugin.cpp @@ -44,6 +44,9 @@ DispSheetIdPlugin::~DispSheetIdPlugin() QAction *a = menuManager->action( "SheetIdView" ); menuManager->unregisterAction( "SheetIdView" ); delete a; + + delete m_LibContext; + m_LibContext = NULL; } bool DispSheetIdPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp b/code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp index 075ac41b2..f1b419e4e 100644 --- a/code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp +++ b/code/studio/src/plugins/georges_editor/georges_editor_plugin.cpp @@ -39,6 +39,9 @@ GeorgesEditorPlugin::~GeorgesEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool GeorgesEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp b/code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp index d0fea4df3..d5f2403f1 100644 --- a/code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp +++ b/code/studio/src/plugins/gui_editor/gui_editor_plugin.cpp @@ -37,6 +37,9 @@ namespace GUIEditor qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool GUIEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp b/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp index 73a6f5b25..f97aff691 100644 --- a/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp +++ b/code/studio/src/plugins/landscape_editor/landscape_editor_plugin.cpp @@ -39,6 +39,9 @@ LandscapeEditorPlugin::~LandscapeEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool LandscapeEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/log/log_plugin.cpp b/code/studio/src/plugins/log/log_plugin.cpp index 0f86ab90c..2017ed91a 100644 --- a/code/studio/src/plugins/log/log_plugin.cpp +++ b/code/studio/src/plugins/log/log_plugin.cpp @@ -62,6 +62,9 @@ namespace Plugin NLMISC::AssertLog->removeDisplayer(m_displayer); NLMISC::InfoLog->removeDisplayer(m_displayer); delete m_displayer; + + delete m_libContext; + m_libContext = NULL; } bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp index 98b188fd3..46e51f36d 100644 --- a/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp +++ b/code/studio/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -30,6 +30,9 @@ MissionCompilerPlugin::~MissionCompilerPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_LibContext; + m_LibContext = NULL; } bool MissionCompilerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp b/code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp index 34fc0f1b4..dce7ad08f 100644 --- a/code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp +++ b/code/studio/src/plugins/object_viewer/object_viewer_plugin.cpp @@ -23,6 +23,9 @@ ObjectViewerPlugin::~ObjectViewerPlugin() qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); Modules::release(); + + delete _LibContext; + _LibContext = NULL; } bool ObjectViewerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp index 8ea90fdc5..21358ec6f 100644 --- a/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp +++ b/code/studio/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp @@ -45,6 +45,9 @@ SheetBuilderPlugin::~SheetBuilderPlugin() QAction *a = menuManager->action( "SheetBuilder" ); menuManager->unregisterAction( "SheetBuilder" ); delete a; + + delete m_LibContext; + m_LibContext = NULL; } bool SheetBuilderPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp b/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp index ac12766b8..33a617cc1 100644 --- a/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp +++ b/code/studio/src/plugins/tile_editor/tile_editor_plugin.cpp @@ -42,6 +42,9 @@ TileEditorPlugin::~TileEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_LibContext; + m_LibContext = NULL; } bool TileEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp b/code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp index 20359ccbd..3fafc7510 100644 --- a/code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp +++ b/code/studio/src/plugins/translation_manager/translation_manager_plugin.cpp @@ -48,6 +48,9 @@ TranslationManagerPlugin::~TranslationManagerPlugin() } qDeleteAll(_autoReleaseObjects); _autoReleaseObjects.clear(); + + delete _LibContext; + _LibContext = NULL; } bool TranslationManagerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) diff --git a/code/studio/src/plugins/world_editor/world_editor_plugin.cpp b/code/studio/src/plugins/world_editor/world_editor_plugin.cpp index 301939cb6..3170bce60 100644 --- a/code/studio/src/plugins/world_editor/world_editor_plugin.cpp +++ b/code/studio/src/plugins/world_editor/world_editor_plugin.cpp @@ -43,6 +43,9 @@ WorldEditorPlugin::~WorldEditorPlugin() } qDeleteAll(m_autoReleaseObjects); m_autoReleaseObjects.clear(); + + delete m_libContext; + m_libContext = NULL; } bool WorldEditorPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString)