soc.2008.masterpassword: 7fec7c54: Don't crash if we're closing while the i...

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 22 04:41:32 EST 2011


----------------------------------------------------------------------
Revision: 7fec7c54b956f2edd3138f6873f9a535b036bf4c
Parent:   b70b7c7ac4e4413c69d89b4f560d85770185c208
Author:   qulogic at pidgin.im
Date:     11/21/11 23:14:47
Branch:   im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/7fec7c54b956f2edd3138f6873f9a535b036bf4c

Changelog: 

Don't crash if we're closing while the instance is already in the midst
of being destroyed.

Changes against parent b70b7c7ac4e4413c69d89b4f560d85770185c208

  patched  libpurple/plugins/keyrings/kwallet.cpp

-------------- next part --------------
============================================================
--- libpurple/plugins/keyrings/kwallet.cpp	5bacbc8a02d80f8ecb939962b3c5dd01e1300a45
+++ libpurple/plugins/keyrings/kwallet.cpp	03fe303b6707030b4d08e29ba1349ca0f430ddf3
@@ -72,6 +72,7 @@ class engine : private QObject, private 
 		~engine();
 		void queue(request *req);
 		static engine *Instance();
+		bool closing;
 
 	private slots:
 		void walletOpened(bool opened);
@@ -129,6 +130,8 @@ KWalletPlugin::engine::~engine()
 
 KWalletPlugin::engine::~engine()
 {
+	closing = true;
+
 	while (!isEmpty()) {
 		request *req = dequeue();
 		req->abort();
@@ -285,7 +288,8 @@ kwallet_close(GError **error)
 static void
 kwallet_close(GError **error)
 {
-	delete KWalletPlugin::engine::Instance();
+	if (!KWalletPlugin::engine::Instance()->closing)
+		delete KWalletPlugin::engine::Instance();
 }
 
 static gboolean


More information about the Commits mailing list