aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2016-09-14 19:50:16 +0200
committerAxel Davy <[email protected]>2016-10-10 23:43:51 +0200
commit8ceb2264c571c7ca03cc9fbd08df92f3bea89372 (patch)
treef8f9e254623a57b5592eb84c2a5ceb68d9cf84af /src/gallium
parentf2eacef33de8d7b136b485927cb10f15d7439d48 (diff)
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 <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/nine/iunknown.c5
1 files changed, 4 insertions, 1 deletions
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;
}