Commit f0d7fadd authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Fixed segfault when closing GE.

parent 2ce662fe
...@@ -309,12 +309,6 @@ void CoWowQt::PopList(void* data) ...@@ -309,12 +309,6 @@ void CoWowQt::PopList(void* data)
pop(ctx); pop(ctx);
} }
void CoWowQt::DeleteList(void* data)
{
CoWowListWidgetQt* ctx = (CoWowListWidgetQt*)data;
ctx->close();
}
void CoWowWarrantQt::reject() void CoWowWarrantQt::reject()
{ {
QDialog::reject(); QDialog::reject();
......
...@@ -196,7 +196,6 @@ public: ...@@ -196,7 +196,6 @@ public:
void(action_cb)(void*, char*, int), void(cancel_cb)(void*), void* ctx, void(action_cb)(void*, char*, int), void(cancel_cb)(void*), void* ctx,
int show_apply_button = 0); int show_apply_button = 0);
void PopList(void* ctx); void PopList(void* ctx);
void DeleteList(void* ctx);
void CreateFileSelDia(const char* title, void* parent_ctx, void CreateFileSelDia(const char* title, void* parent_ctx,
void (*file_selected_cb)(void*, char*, wow_eFileSelType), void (*file_selected_cb)(void*, char*, wow_eFileSelType),
wow_eFileSelType file_type, wow_eFileSelAction action); wow_eFileSelType file_type, wow_eFileSelAction action);
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#include "wb_wnav_selformat.h" #include "wb_wnav_selformat.h"
#include <QApplication> #include <QApplication>
#include <QCloseEvent>
#include <QFontDatabase> #include <QFontDatabase>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QInputDialog> #include <QInputDialog>
...@@ -1237,7 +1238,7 @@ void GeQt::update() ...@@ -1237,7 +1238,7 @@ void GeQt::update()
void GeQtWidget::closeEvent(QCloseEvent* event) void GeQtWidget::closeEvent(QCloseEvent* event)
{ {
ge->Ge::activate_exit(); ge->Ge::activate_exit();
QWidget::closeEvent(event); event->ignore();
} }
void GeQtWidget::focusInEvent(QFocusEvent* event) void GeQtWidget::focusInEvent(QFocusEvent* event)
...@@ -1266,11 +1267,11 @@ GeQt::~GeQt() ...@@ -1266,11 +1267,11 @@ GeQt::~GeQt()
} }
if (open_dialog) { if (open_dialog) {
wow->DeleteList(open_dialog); ((CoWowListWidgetQt*)open_dialog)->close();
} }
if (subgraphs_widget) { if (subgraphs) {
subgraphs_widget->close(); delete subgraphs;
} }
delete subpalette; delete subpalette;
delete recall_entry; delete recall_entry;
...@@ -1288,7 +1289,7 @@ GeQt::~GeQt() ...@@ -1288,7 +1289,7 @@ GeQt::~GeQt()
delete objectnav; delete objectnav;
} }
toplevel->close(); delete toplevel;
if (exit_when_close) { if (exit_when_close) {
exit(0); exit(0);
...@@ -1325,7 +1326,6 @@ GeQt::GeQt(void* x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close, ...@@ -1325,7 +1326,6 @@ GeQt::GeQt(void* x_parent_ctx, ldh_tSesContext x_ldhses, int x_exit_when_close,
toplevel->setMinimumSize(window_width, window_height); toplevel->setMinimumSize(window_width, window_height);
toplevel->setWindowTitle(fl(title)); toplevel->setWindowTitle(fl(title));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
CoWowQt::SetWindowIcon(toplevel); CoWowQt::SetWindowIcon(toplevel);
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "ge_attr_qt.h" #include "ge_attr_qt.h"
#include "ge_subgraphs_qt.h" #include "ge_subgraphs_qt.h"
#include <QCloseEvent>
#include <QMenuBar> #include <QMenuBar>
#include <QTimer> #include <QTimer>
#include <QVBoxLayout> #include <QVBoxLayout>
...@@ -57,7 +58,7 @@ void SubGraphsQtWidget::closeEvent(QCloseEvent* event) ...@@ -57,7 +58,7 @@ void SubGraphsQtWidget::closeEvent(QCloseEvent* event)
trace_timerid->stop(); trace_timerid->stop();
delete subgraphs; delete subgraphs;
} }
QWidget::closeEvent(event); event->ignore();
} }
void SubGraphsQtWidget::focusInEvent(QFocusEvent* event) void SubGraphsQtWidget::focusInEvent(QFocusEvent* event)
...@@ -119,7 +120,6 @@ SubGraphsQt::SubGraphsQt(void* xn_parent_ctx, const char* xn_name, ...@@ -119,7 +120,6 @@ SubGraphsQt::SubGraphsQt(void* xn_parent_ctx, const char* xn_name,
toplevel = new SubGraphsQtWidget(this); toplevel = new SubGraphsQtWidget(this);
toplevel->setMinimumSize(300, 500); toplevel->setMinimumSize(300, 500);
toplevel->setWindowTitle(fl(name)); toplevel->setWindowTitle(fl(name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
// Menu // Menu
QMenuBar* menu_bar = new QMenuBar(toplevel); QMenuBar* menu_bar = new QMenuBar(toplevel);
...@@ -171,6 +171,8 @@ SubGraphsQt::~SubGraphsQt() ...@@ -171,6 +171,8 @@ SubGraphsQt::~SubGraphsQt()
} }
delete brow; delete brow;
delete toplevel;
} }
void SubGraphsQt::trace_start() void SubGraphsQt::trace_start()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment