On 3 March 2016 at 09:10, Nikolay Sivov nsivov@codeweavers.com wrote:
+HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) +{
- struct destroy_callback *callback, *callback2;
- if (!cb)
return D3DRMERR_BADVALUE;
- LIST_FOR_EACH_ENTRY_SAFE(callback, callback2, &object->destroy_callbacks, struct destroy_callback, entry)
- {
if (callback->cb == cb && callback->ctx == ctx)
{
list_remove(&callback->entry);
HeapFree(GetProcessHeap(), 0, callback);
}
- }
- return D3DRM_OK;
+}
I won't hold it against the patch (much), but is that correct? E.g. suppose you do something like the following: add cb1 add cb2 add cb3 add cb2 delete cb2 What would the sequence be that ends up getting called?
On 03.03.2016 15:29, Henri Verbeet wrote:
On 3 March 2016 at 09:10, Nikolay Sivov nsivov@codeweavers.com wrote:
+HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) +{
- struct destroy_callback *callback, *callback2;
- if (!cb)
return D3DRMERR_BADVALUE;
- LIST_FOR_EACH_ENTRY_SAFE(callback, callback2, &object->destroy_callbacks, struct destroy_callback, entry)
- {
if (callback->cb == cb && callback->ctx == ctx)
{
list_remove(&callback->entry);
HeapFree(GetProcessHeap(), 0, callback);
}
- }
- return D3DRM_OK;
+}
I won't hold it against the patch (much), but is that correct? E.g. suppose you do something like the following: add cb1 add cb2 add cb3 add cb2 delete cb2 What would the sequence be that ends up getting called?
Thanks for spotting this, I've just sent a fix.