remove singletons when qt is still initialized; refs #170
This commit is contained in:
@@ -241,6 +241,8 @@ class Browser: public QMainWindow, protected Ui::Browser {
|
|||||||
~Browser() {
|
~Browser() {
|
||||||
TRC;
|
TRC;
|
||||||
QWebSettings::clearIconDatabase();
|
QWebSettings::clearIconDatabase();
|
||||||
|
qbrowserlib::Settings::purge(); // free singleton
|
||||||
|
qbrowserlib::ErrorLog::purge(); // free singleton
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Whitelisting
|
//! Whitelisting
|
||||||
|
|||||||
@@ -26,8 +26,11 @@ namespace qbrowserlib {
|
|||||||
public:
|
public:
|
||||||
//! Singleton
|
//! Singleton
|
||||||
static ErrorLog& instance(QWidget* p=0) {
|
static ErrorLog& instance(QWidget* p=0) {
|
||||||
static ErrorLog _instance(p);
|
static ErrorLog* _instance(new ErrorLog(p));
|
||||||
return _instance;
|
return *_instance;
|
||||||
|
}
|
||||||
|
static void purge() {
|
||||||
|
delete &instance();
|
||||||
}
|
}
|
||||||
private: // singleton
|
private: // singleton
|
||||||
ErrorLog(const ErrorLog&);
|
ErrorLog(const ErrorLog&);
|
||||||
|
|||||||
@@ -39,8 +39,13 @@ namespace qbrowserlib {
|
|||||||
//! Singleton
|
//! Singleton
|
||||||
static Settings& instance(MimeTypes mimetypes=MimeTypes(), QWidget* p=0,
|
static Settings& instance(MimeTypes mimetypes=MimeTypes(), QWidget* p=0,
|
||||||
QSettings* settings=0, bool autoWrite=true) {
|
QSettings* settings=0, bool autoWrite=true) {
|
||||||
static Settings _instance(mimetypes, p, settings, autoWrite);
|
static Settings* _instance
|
||||||
return _instance;
|
(new Settings(mimetypes, p, settings, autoWrite));
|
||||||
|
return *_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void purge() {
|
||||||
|
delete &instance();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user