aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/completionmodels.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/completionmodels.cpp')
-rw-r--r--qt-ui/completionmodels.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qt-ui/completionmodels.cpp b/qt-ui/completionmodels.cpp
index 31733addb..ed1699a92 100644
--- a/qt-ui/completionmodels.cpp
+++ b/qt-ui/completionmodels.cpp
@@ -1,11 +1,12 @@
#include "completionmodels.h"
#include "dive.h"
+#include "mainwindow.h"
#define CREATE_SINGLETON(X) \
X* X::instance() \
{ \
- static X* self = new X(); \
- return self; \
+ static QScopedPointer<X> self(new X()); \
+ return self.data(); \
}
CREATE_SINGLETON(BuddyCompletionModel);