28 Dec
2018
28 Dec
'18
5:05 p.m.
I don't think you need SAFE iterators for Get/Set.
+ EnterCriticalSection(&object->lock); + + if (!list_empty(&object->attributes)) + { + struct mfattribute *attribute, *attribute2; + + LIST_FOR_EACH_ENTRY_SAFE(attribute, attribute2, &object->attributes, struct mfattribute, entry) + { + PropVariantClear(&attribute->value); + list_remove(&attribute->entry); + heap_free(attribute); + } + } + + LeaveCriticalSection(&object->lock); + + object->lock.DebugInfo->Spare[0] = 0; + DeleteCriticalSection(&object->lock); Empty list check is redundant.