Return-Path: X-Original-To: apmail-celix-commits-archive@www.apache.org Delivered-To: apmail-celix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 629A0109BF for ; Tue, 10 Feb 2015 12:40:52 +0000 (UTC) Received: (qmail 66448 invoked by uid 500); 10 Feb 2015 12:40:52 -0000 Delivered-To: apmail-celix-commits-archive@celix.apache.org Received: (qmail 66424 invoked by uid 500); 10 Feb 2015 12:40:52 -0000 Mailing-List: contact commits-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list commits@celix.apache.org Received: (qmail 66413 invoked by uid 99); 10 Feb 2015 12:40:52 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2015 12:40:52 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 0189FAC006C for ; Tue, 10 Feb 2015 12:40:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1658700 - /celix/trunk/framework/private/src/framework.c Date: Tue, 10 Feb 2015 12:40:51 -0000 To: commits@celix.apache.org From: abroekhuis@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150210124052.0189FAC006C@hades.apache.org> Author: abroekhuis Date: Tue Feb 10 12:40:51 2015 New Revision: 1658700 URL: http://svn.apache.org/r1658700 Log: CELIX-218: Fixed library unloading by using the correct handles. Modified: celix/trunk/framework/private/src/framework.c Modified: celix/trunk/framework/private/src/framework.c URL: http://svn.apache.org/viewvc/celix/trunk/framework/private/src/framework.c?rev=1658700&r1=1658699&r2=1658700&view=diff ============================================================================== --- celix/trunk/framework/private/src/framework.c (original) +++ celix/trunk/framework/private/src/framework.c Tue Feb 10 12:40:51 2015 @@ -958,7 +958,14 @@ celix_status_t fw_uninstallBundle(framew status = CELIX_DO_IF(status, framework_setBundleStateAndNotify(framework, bundle, OSGI_FRAMEWORK_BUNDLE_INSTALLED)); // TODO Unload all libraries for transition to unresolved - dlclose(bundle_getHandle(bundle)); + bundle_revision_pt revision = NULL; + array_list_pt handles = NULL; + status = CELIX_DO_IF(status, bundleArchive_getCurrentRevision(archive, &revision)); + status = CELIX_DO_IF(status, bundleRevision_getHandles(revision, &handles)); + for (int i = arrayList_size(handles) - 1; i >= 0; i--) { + void *handle = arrayList_get(handles, i); + fw_closeLibrary(handle); + } status = CELIX_DO_IF(status, fw_fireBundleEvent(framework, OSGI_FRAMEWORK_BUNDLE_EVENT_UNRESOLVED, bundle)); @@ -2389,7 +2396,7 @@ static celix_status_t framework_loadLibr status = CELIX_DO_IF(status, bundleArchive_getCurrentRevision(archive, &revision)); status = CELIX_DO_IF(status, bundleRevision_getHandles(revision, &handles)); - arrayList_add(handles, handle); + arrayList_add(handles, *handle); } framework_logIfError(framework->logger, status, error, "Could not load library: %s", libraryPath);