From: Krzysztof Opasiak Date: Wed, 1 Jul 2015 18:58:19 +0000 (+0200) Subject: Fix: call release() when suitable X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7b3b8c93989c5c66110fa22018cd6fb0c8f2510;p=platform%2Fcore%2Fapi%2Fusb-host.git Fix: call release() when suitable Change-Id: I56a065b085d0fcb472a314f8796e177751f9c1d9 Signed-off-by: Krzysztof Opasiak --- diff --git a/include/uref.h b/include/uref.h index d7b09a4..d9f5522 100644 --- a/include/uref.h +++ b/include/uref.h @@ -51,6 +51,8 @@ static inline void uref_sub(struct uref *uref, unsigned count) { assert(uref->refcnt >= count); uref->refcnt -= count; + if (uref->refcnt == 0 && uref->release) + uref->release(uref); } static inline void uref_put(struct uref *uref)