aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/device9.c
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-12-28 18:58:48 +0100
committerAxel Davy <[email protected]>2017-01-12 20:33:11 +0100
commit5f4359ea0ed54b06d443e0ba040eb73406fc3e34 (patch)
treebe18aba00eb368babf8798bb7b9ff08883fd9263 /src/gallium/state_trackers/nine/device9.c
parent4e922c81f616bba71565de8d7fd8f5f6955ce1cc (diff)
st/nine: Flush the queue at device dtor
Flush the queue to get refcounts right, and properly release the items, instead of throwing away all pending commands. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/device9.c')
-rw-r--r--src/gallium/state_trackers/nine/device9.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index b150faaf49d..92bc72ce28d 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -535,8 +535,13 @@ NineDevice9_dtor( struct NineDevice9 *This )
DBG("This=%p\n", This);
- /* Do not call nine_csmt_process here. The device is dead! */
+ /* Flush all pending commands to get refcount right,
+ * and properly release bound objects. It is ok to still
+ * execute commands while we are in device dtor, because
+ * we haven't released anything yet. Note that no pending
+ * command can increase the device refcount. */
if (This->csmt_active && This->csmt_ctx) {
+ nine_csmt_process(This);
nine_csmt_destroy(This, This->csmt_ctx);
This->csmt_active = FALSE;
This->csmt_ctx = NULL;