mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-05 20:56:15 +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);
|
||||
q->SetSizer(hsizer);
|
||||
|
||||
menus.init(q);
|
||||
|
||||
// Events:
|
||||
|
||||
if (wxGetApp().is_editor()) {
|
||||
menus.init(q);
|
||||
|
||||
// Events:
|
||||
|
||||
// Preset change event
|
||||
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(); });
|
||||
|
@ -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
|
||||
// layer separation procedure for SLA printers.
|
||||
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");
|
||||
|
||||
update_dirty();
|
||||
|
@ -106,7 +106,7 @@ void TopBarMenus::UpdateAccountMenu()
|
||||
void TopBarMenus::RemoveHideLoginItem()
|
||||
{
|
||||
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)
|
||||
|
@ -225,7 +225,13 @@ UserAccountCommunication::UserAccountCommunication(wxEvtHandler* evt_handler, Ap
|
||||
UserAccountCommunication::~UserAccountCommunication()
|
||||
{
|
||||
m_token_timer->Stop();
|
||||
delete m_token_timer;
|
||||
m_token_timer = nullptr;
|
||||
|
||||
m_polling_timer->Stop();
|
||||
delete m_polling_timer;
|
||||
m_polling_timer = nullptr;
|
||||
|
||||
if (m_thread.joinable()) {
|
||||
// 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);
|
||||
accelerator_entries_cache().push_back(entry);
|
||||
}
|
||||
else {
|
||||
delete entry;
|
||||
entry = nullptr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -27,6 +27,11 @@ PresetUpdaterWrapper::~PresetUpdaterWrapper()
|
||||
if (m_ui_status)
|
||||
m_ui_status->set_canceled(true);
|
||||
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