Use a boolean expression for refcount check, fixes refcounting if bool is a signed char
This commit is contained in:
@@ -287,7 +287,7 @@ bool ref_put(refcount_t *ref)
|
|||||||
bool more_refs;
|
bool more_refs;
|
||||||
|
|
||||||
pthread_mutex_lock(&ref_mutex);
|
pthread_mutex_lock(&ref_mutex);
|
||||||
more_refs = --(*ref);
|
more_refs = --(*ref) > 0;
|
||||||
pthread_mutex_unlock(&ref_mutex);
|
pthread_mutex_unlock(&ref_mutex);
|
||||||
return !more_refs;
|
return !more_refs;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user