Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=d73f9d64c8d18fa68dd75a76bde8af04e21adab9

commit d73f9d64c8d18fa68dd75a76bde8af04e21adab9
Author: Michel Hermier <[email protected]>
Date:   Tue Jun 3 14:27:43 2014 +0200

libpacman: Use fAcquire fRelease.

diff --git a/lib/libpacman/sync.cpp b/lib/libpacman/sync.cpp
index 1e71a5f..a0d7915 100644
--- a/lib/libpacman/sync.cpp
+++ b/lib/libpacman/sync.cpp
@@ -66,11 +66,10 @@ __pmsyncpkg_t::__pmsyncpkg_t(int type, Package *spkg, void 
*data)
this->type = type;
this->pkg_name = spkg->name();
this->pkg_new = spkg;
-       this->pkg_new->acquire();
+       fAcquire(this->pkg_new);
this->data = data;
-       if((this->pkg_local = _pacman_db_get_pkgfromcache(handle->db_local, 
this->pkg_name)) != NULL) {
-               this->pkg_local->acquire();
-       }
+       this->pkg_local = _pacman_db_get_pkgfromcache(handle->db_local, 
this->pkg_name);
+       fAcquire(this->pkg_local);
}

__pmsyncpkg_t::~__pmsyncpkg_t()
@@ -78,10 +77,8 @@ __pmsyncpkg_t::~__pmsyncpkg_t()
if(type == PM_SYNC_TYPE_REPLACE) {
FREELISTPKGS(data);
}
-       pkg_new->release();
-       if(pkg_local != NULL) {
-               pkg_local->release();
-       }
+       fRelease(pkg_new);
+       fRelease(pkg_local);
}

/* vim: set ts=2 sw=2 noet: */
diff --git a/lib/libpacman/trans.cpp b/lib/libpacman/trans.cpp
index 646851a..85b14e8 100644
--- a/lib/libpacman/trans.cpp
+++ b/lib/libpacman/trans.cpp
@@ -2034,9 +2034,7 @@ int __pmtrans_t::commit(pmlist_t **data)

}
EVENT(this, trans_event_table[type].post.event, event_arg0, event_arg1);
-               if (pkg_local) {
-                       pkg_local->release();
-               }
+               fRelease(pkg_local);
}

/* run ldconfig if it exists */
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to