From fe3a1729b4212d30ca07ee6a8fb12e27bdb70ed8 Mon Sep 17 00:00:00 2001 From: ssitar583 Date: Wed, 6 Nov 2024 18:57:50 +0530 Subject: [PATCH] DELIA-66586: WPEFramework crash with signature "WPEFramework::Plugin::Packager::Deinitialize" Reason for Change: Fixed the packager plugin failed crash issue. Test Procedure: Refer the ticket Priority: P1 --- Packager/Packager.cpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Packager/Packager.cpp b/Packager/Packager.cpp index 0eb713a1b2..690c1d09f6 100644 --- a/Packager/Packager.cpp +++ b/Packager/Packager.cpp @@ -73,23 +73,25 @@ namespace { { ASSERT(_service == service); - _service->Unregister(&_notification); - - if (_implementation->Release() != Core::ERROR_DESTRUCTION_SUCCEEDED) { - - ASSERT(_connectionId != 0); + if (_service != nullptr) { + _service->Unregister(&_notification); +} - RPC::IRemoteConnection* connection(_service->RemoteConnection(_connectionId)); + if (_implementation != nullptr) { + if (_implementation->Release() != Core::ERROR_DESTRUCTION_SUCCEEDED) { + ASSERT(_connectionId != 0); - // The process can disappear in the meantime... - if (connection != nullptr) { + RPC::IRemoteConnection* connection(_service->RemoteConnection(_connectionId)); - // But if it did not dissapear in the meantime, forcefully terminate it. Shoot to kill :-) - connection->Terminate(); - connection->Release(); - } - } + // The process can disappear in the meantime... + if (connection != nullptr) { + // But if it did not dissapear in the meantime, forcefully terminate it. Shoot to kill :-) + connection->Terminate(); + connection->Release(); + } + } + } _service = nullptr; _implementation = nullptr; }