mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-09-26 10:23:12 +08:00
Fixed some of detected memory leaks
This commit is contained in:
parent
ee98a1c31b
commit
254776dd6c
@ -694,11 +694,11 @@ void Plater::priv::init()
|
|||||||
hsizer->Add(sidebar, 0, wxEXPAND | wxLEFT | wxRIGHT, 0);
|
hsizer->Add(sidebar, 0, wxEXPAND | wxLEFT | wxRIGHT, 0);
|
||||||
q->SetSizer(hsizer);
|
q->SetSizer(hsizer);
|
||||||
|
|
||||||
menus.init(q);
|
|
||||||
|
|
||||||
// Events:
|
|
||||||
|
|
||||||
if (wxGetApp().is_editor()) {
|
if (wxGetApp().is_editor()) {
|
||||||
|
menus.init(q);
|
||||||
|
|
||||||
|
// Events:
|
||||||
|
|
||||||
// Preset change event
|
// Preset change event
|
||||||
this->q->Bind(EVT_OBJ_LIST_OBJECT_SELECT, [this](wxEvent&) { priv::selection_changed(); });
|
this->q->Bind(EVT_OBJ_LIST_OBJECT_SELECT, [this](wxEvent&) { priv::selection_changed(); });
|
||||||
this->q->Bind(EVT_SCHEDULE_BACKGROUND_PROCESS, [this](SimpleEvent&) { this->schedule_background_process(); });
|
this->q->Bind(EVT_SCHEDULE_BACKGROUND_PROCESS, [this](SimpleEvent&) { this->schedule_background_process(); });
|
||||||
|
@ -5507,9 +5507,9 @@ void TabSLAMaterial::build_tilt_group(Slic3r::GUI::PageShp page)
|
|||||||
// TRN: 'Profile' in this context denotes a group of parameters used to configure
|
// TRN: 'Profile' in this context denotes a group of parameters used to configure
|
||||||
// layer separation procedure for SLA printers.
|
// layer separation procedure for SLA printers.
|
||||||
auto optgroup = page->new_optgroup(L("Profile settings"));
|
auto optgroup = page->new_optgroup(L("Profile settings"));
|
||||||
optgroup->on_change = [this, optgroup](const t_config_option_key& key, boost::any value)
|
optgroup->on_change = [this](const t_config_option_key& key, boost::any value)
|
||||||
{
|
{
|
||||||
if (key.find_first_of("use_tilt") == 0)
|
if (key.find("use_tilt") == 0)
|
||||||
toggle_tilt_options(key == "use_tilt#0");
|
toggle_tilt_options(key == "use_tilt#0");
|
||||||
|
|
||||||
update_dirty();
|
update_dirty();
|
||||||
|
@ -106,7 +106,7 @@ void TopBarMenus::UpdateAccountMenu()
|
|||||||
void TopBarMenus::RemoveHideLoginItem()
|
void TopBarMenus::RemoveHideLoginItem()
|
||||||
{
|
{
|
||||||
if (m_hide_login_item)
|
if (m_hide_login_item)
|
||||||
account.Remove(m_hide_login_item);
|
account.Destroy(m_hide_login_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TopBarMenus::Popup(TopBarItemsCtrl* popup_ctrl, wxMenu* menu, wxPoint pos)
|
void TopBarMenus::Popup(TopBarItemsCtrl* popup_ctrl, wxMenu* menu, wxPoint pos)
|
||||||
|
@ -225,7 +225,13 @@ UserAccountCommunication::UserAccountCommunication(wxEvtHandler* evt_handler, Ap
|
|||||||
UserAccountCommunication::~UserAccountCommunication()
|
UserAccountCommunication::~UserAccountCommunication()
|
||||||
{
|
{
|
||||||
m_token_timer->Stop();
|
m_token_timer->Stop();
|
||||||
|
delete m_token_timer;
|
||||||
|
m_token_timer = nullptr;
|
||||||
|
|
||||||
m_polling_timer->Stop();
|
m_polling_timer->Stop();
|
||||||
|
delete m_polling_timer;
|
||||||
|
m_polling_timer = nullptr;
|
||||||
|
|
||||||
if (m_thread.joinable()) {
|
if (m_thread.joinable()) {
|
||||||
// Stop the worker thread, if running.
|
// Stop the worker thread, if running.
|
||||||
{
|
{
|
||||||
|
@ -117,6 +117,10 @@ wxMenuItem* append_menu_item(wxMenu* menu, int id, const wxString& string, const
|
|||||||
entry->SetMenuItem(item);
|
entry->SetMenuItem(item);
|
||||||
accelerator_entries_cache().push_back(entry);
|
accelerator_entries_cache().push_back(entry);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
delete entry;
|
||||||
|
entry = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -27,6 +27,11 @@ PresetUpdaterWrapper::~PresetUpdaterWrapper()
|
|||||||
if (m_ui_status)
|
if (m_ui_status)
|
||||||
m_ui_status->set_canceled(true);
|
m_ui_status->set_canceled(true);
|
||||||
m_worker_thread.join();
|
m_worker_thread.join();
|
||||||
|
|
||||||
|
if (m_ui_status) {
|
||||||
|
delete m_ui_status;
|
||||||
|
m_ui_status = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user