added a FREESYNC macro to release pointers to pmsyncpkg_t structures
This commit is contained in:
parent
b2df466ffd
commit
2e559ba431
2 changed files with 3 additions and 2 deletions
|
@ -31,6 +31,8 @@ typedef struct __pmsyncpkg_t {
|
|||
void *data;
|
||||
} pmsyncpkg_t;
|
||||
|
||||
#define FREESYNC(p) do { if(p) { sync_free(p); p = NULL; } } while(0)
|
||||
|
||||
pmsyncpkg_t *sync_new(int type, pmpkg_t *spkg, void *data);
|
||||
void sync_free(pmsyncpkg_t *sync);
|
||||
|
||||
|
|
|
@ -66,8 +66,7 @@ void trans_free(pmtrans_t *trans)
|
|||
if(trans->type == PM_TRANS_TYPE_SYNC) {
|
||||
PMList *i;
|
||||
for(i = trans->packages; i; i = i->next) {
|
||||
sync_free(i->data);
|
||||
i->data = NULL;
|
||||
FREESYNC(i->data);
|
||||
}
|
||||
FREELIST(trans->packages);
|
||||
FREELIST(trans->skiplist);
|
||||
|
|
Loading…
Add table
Reference in a new issue