From 8ceb2264c571c7ca03cc9fbd08df92f3bea89372 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Wed, 14 Sep 2016 19:50:16 +0200 Subject: [PATCH] st/nine: Fix assert in NineUnknown_QueryInterface 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 Reviewed-by: Axel Davy --- src/gallium/state_trackers/nine/iunknown.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/iunknown.c b/src/gallium/state_trackers/nine/iunknown.c index 6d501d8681b..89b82ea7092 100644 --- a/src/gallium/state_trackers/nine/iunknown.c +++ b/src/gallium/state_trackers/nine/iunknown.c @@ -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; } -- 2.30.2