st/nine: Fix assert in NineUnknown_QueryInterface
authorPatrick Rudolph <siro@das-labor.org>
Wed, 14 Sep 2016 17:50:16 +0000 (19:50 +0200)
committerAxel Davy <axel.davy@ens.fr>
Mon, 10 Oct 2016 21:43:51 +0000 (23:43 +0200)
Tests showed that is allowed to call this method on
object that have a zero refcount.
Required for issue #230.

Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/iunknown.c

index 6d501d8..89b82ea 100644 (file)
@@ -70,7 +70,10 @@ NineUnknown_QueryInterface( struct NineUnknown *This,
     do {
         if (GUID_equal(This->guids[i], riid)) {
             *ppvObject = This;
-            assert(This->refs);
+            /* Tests showed that this call succeeds even on objects with
+             * zero refcount. This can happen if the app released all references
+             * but the resource is still bound.
+             */
             NineUnknown_AddRef(This);
             return S_OK;
         }