Fix crash on save in 'DatabaseManage' (and possibly other stuff that uses progresswindow)
This commit is contained in:
parent
471f1ac526
commit
586d0d90dc
@ -138,14 +138,14 @@ void DatabaseWindow::save() {
|
|||||||
app->add_window( *pw );
|
app->add_window( *pw );
|
||||||
|
|
||||||
t = std::thread( refreshSelectDB, std::ref( changed_rows ), linux, pw );
|
t = std::thread( refreshSelectDB, std::ref( changed_rows ), linux, pw );
|
||||||
// lambda capture
|
t.detach();
|
||||||
auto app_ptr = app;
|
|
||||||
auto *thread = &t;
|
|
||||||
|
|
||||||
pw->signal_hide().connect( [pw, app_ptr, thread]() {
|
// lambda capture
|
||||||
|
auto *app_ptr = app.get();
|
||||||
|
|
||||||
|
pw->signal_hide().connect( [pw, app_ptr]() {
|
||||||
cleanDB();
|
cleanDB();
|
||||||
app_ptr->remove_window( *pw );
|
app_ptr->remove_window( *pw );
|
||||||
thread->join();
|
|
||||||
delete pw;
|
delete pw;
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ void ProgressBar::print( const string &t ) {
|
|||||||
|
|
||||||
ProgressBar::~ProgressBar() {
|
ProgressBar::~ProgressBar() {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
static_cast< ProgressWindow * >( ptr )->~ProgressWindow();
|
static_cast< ProgressWindow * >( ptr )->hide();
|
||||||
#else
|
#else
|
||||||
PostMessageW( ptr, WM_APP, 2, 0 );
|
PostMessageW( ptr, WM_APP, 2, 0 );
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user