Flush the queue to get refcounts right, and properly release the items, instead of throwing away all pending commands.
Signed-off-by: Axel Davy <axel.d...@ens.fr> --- src/gallium/state_trackers/nine/device9.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 03564203df..1a0ab035c7 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -537,8 +537,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; -- 2.11.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev