summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-02-08 19:04:24 +0000
committerDavid Robillard <d@drobilla.net>2014-02-08 19:04:24 +0000
commit76dd49933b94061ac7d71cef20447f4a43086fd5 (patch)
tree5017761bdc1c2194b1ed9ac64728f9cddf4e6234 /src
parent7c92d5922dfa1423fc12fe331c32426ee7be185e (diff)
downloadsuil-76dd49933b94061ac7d71cef20447f4a43086fd5.tar.gz
suil-76dd49933b94061ac7d71cef20447f4a43086fd5.tar.bz2
suil-76dd49933b94061ac7d71cef20447f4a43086fd5.zip
Fix embedding several Qt UIs in Gtk (apply #961).
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5335 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/qt4_in_gtk2.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qt4_in_gtk2.cpp b/src/qt4_in_gtk2.cpp
index 4bd61a2..e958ce6 100644
--- a/src/qt4_in_gtk2.cpp
+++ b/src/qt4_in_gtk2.cpp
@@ -59,7 +59,6 @@ suil_qt_wrapper_finalize(GObject* gobject)
delete self->qembed;
self->qembed = NULL;
- delete self->app;
self->app = NULL;
self->wrapper->impl = NULL;
@@ -144,8 +143,13 @@ suil_wrapper_new(SuilHost* host,
SuilQtWrapper* const wrap = SUIL_QT_WRAPPER(
g_object_new(SUIL_TYPE_QT_WRAPPER, NULL));
- static int argc = 0;
- wrap->app = new QApplication(argc, NULL, true);
+ if (qApp) {
+ wrap->app = qApp;
+ } else {
+ static int argc = 0;
+ wrap->app = new QApplication(argc, NULL, true);
+ }
+
wrap->wrapper = NULL;
wrapper->impl = wrap;