struct astobj2_lockobj *obj_lockobj;
int32_t current_value;
int32_t ret;
+ uint32_t privdataoptions;
struct ao2_weakproxy *weakproxy = NULL;
const char *lock_state;
/* In case someone uses an object after it's been freed */
obj->priv_data.magic = 0;
+ /* Save the options locally so the ref_log print at the end doesn't access freed data */
+ privdataoptions = obj->priv_data.options;
switch (obj->priv_data.options & AO2_ALLOC_OPT_LOCK_MASK) {
case AO2_ALLOC_OPT_LOCK_MUTEX:
break;
}
- if (ref_log && !(obj->priv_data.options & AO2_ALLOC_OPT_NO_REF_DEBUG)) {
+ if (ref_log && !(privdataoptions & AO2_ALLOC_OPT_NO_REF_DEBUG)) {
fprintf(ref_log, "%p,%d,%d,%s,%d,%s,**destructor**lock-state:%s**,%s\n",
user_data, delta, ast_get_tid(), file, line, func, lock_state, tag ?: "");
fflush(ref_log);