aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine
diff options
context:
space:
mode:
authorAxel Davy <[email protected]>2016-02-12 19:08:42 +0100
committerAxel Davy <[email protected]>2016-05-18 23:37:14 +0200
commit2d51c817cdff6ada200e80ecb6819a641aebc462 (patch)
tree441b3e3a0f010f182469380bac50a1df886af654 /src/gallium/state_trackers/nine
parent7fc8391d235e96b66abaa9944241a6935b256023 (diff)
st/nine: Fix leak after ctor failures
Previously ctor failures would not unreference the device. Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine')
-rw-r--r--src/gallium/state_trackers/nine/iunknown.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/iunknown.c b/src/gallium/state_trackers/nine/iunknown.c
index a28c8b2de8b..515ceaa263f 100644
--- a/src/gallium/state_trackers/nine/iunknown.c
+++ b/src/gallium/state_trackers/nine/iunknown.c
@@ -48,6 +48,8 @@ NineUnknown_ctor( struct NineUnknown *This,
void
NineUnknown_dtor( struct NineUnknown *This )
{
+ if (This->refs && This->device) /* Possible only if early exit after a ctor failed */
+ (void) NineUnknown_Release(NineUnknown(This->device));
FREE(This);
}