pidgin/pidgin

Parents 132c763c26e4
Children f3fd62f8c831
Fix a crash on shutdown in kwallet if the wallet was never opened.

The wallet instance variable was not initialized so if the wallet was never opened we were trying to delete and invalid pointer.

Also update the dispose method of the provider to close the wallet as the
tasks in the queue hold a reference to the provider instance as the source
object in their tasks.

Testing Done:
Ran locally with both the kwallet and secret service providers.

Reviewed at https://reviews.imfreedom.org/r/581/
--- a/libpurple/plugins/keyrings/kwallet/purplekwallet.cpp Mon Mar 22 05:56:45 2021 -0500
+++ b/libpurple/plugins/keyrings/kwallet/purplekwallet.cpp Tue Mar 23 02:41:18 2021 -0500
@@ -206,8 +206,11 @@
PurpleKWalletPlugin::Engine::Engine(void) {
this->queue = QQueue<PurpleKWalletPlugin::Request *>();
+ this->wallet = NULL;
+
this->connected = false;
this->failed = false;
+ this->externallyClosed = false;
}
PurpleKWalletPlugin::Engine::~Engine(void) {
@@ -468,8 +471,9 @@
purple_kwallet_provider_dispose(GObject *obj) {
PurpleKWalletProvider *provider = PURPLE_KWALLET_PROVIDER(obj);
- delete provider->engine;
- provider->engine = NULL;
+ if(provider->engine != NULL) {
+ provider->engine->close();
+ }
G_OBJECT_CLASS(purple_kwallet_provider_parent_class)->dispose(obj);
}