Fixed crash-bug when close application after language changing

This commit is contained in:
YuSanka 2018-06-22 12:27:56 +02:00
parent bfe7896709
commit c10e9a6840
3 changed files with 13 additions and 0 deletions

View file

@ -56,6 +56,7 @@
#include "../Utils/PresetUpdater.hpp"
#include "../Config/Snapshot.hpp"
#include "3DScene.hpp"
namespace Slic3r { namespace GUI {
@ -109,6 +110,7 @@ wxNotebook *g_wxTabPanel = nullptr;
AppConfig *g_AppConfig = nullptr;
PresetBundle *g_PresetBundle= nullptr;
PresetUpdater *g_PresetUpdater = nullptr;
_3DScene *g_3DScene = nullptr;
wxColour g_color_label_modified;
wxColour g_color_label_sys;
wxColour g_color_label_default;
@ -194,6 +196,11 @@ void set_preset_updater(PresetUpdater *updater)
g_PresetUpdater = updater;
}
void set_3DScene(_3DScene *scene)
{
g_3DScene = scene;
}
std::vector<Tab *>& get_tabs_list()
{
return g_tabs_list;
@ -392,6 +399,7 @@ void add_config_menu(wxMenuBar *menu, int event_preferences_changed, int event_l
save_language();
show_info(g_wxTabPanel, _(L("Application will be restarted")), _(L("Attention!")));
if (event_language_change > 0) {
g_3DScene->remove_all_canvases();// remove all canvas before recreate GUI
wxCommandEvent event(event_language_change);
g_wxApp->ProcessEvent(event);
}