summaryrefslogtreecommitdiff
path: root/retrace/retrace.py
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-02-19 13:28:24 +0000
committerJosé Fonseca <jfonseca@vmware.com>2013-02-22 09:59:03 +0000
commita936afc3ebb349c3aec8b5a595706f3c9749ad37 (patch)
tree669ea8220b9ec1a9633ecb777035a374d76e5cc2 /retrace/retrace.py
parent677f59a10bf71b0bf1b73bfc9c1accbf719fafad (diff)
d3dretrace: Replay IUnknown::AddRef/Release methods faithfully.
Several D3D APIs (especially recent ones) keep track of reference counts and will ensure errors if reference counting is not properly done. For example, IDXGISwapChain::ResizeBuffers will fail if there are outstanding references to its buffers.
Diffstat (limited to 'retrace/retrace.py')
-rw-r--r--retrace/retrace.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/retrace/retrace.py b/retrace/retrace.py
index d09d72aa..70926c0b 100644
--- a/retrace/retrace.py
+++ b/retrace/retrace.py
@@ -478,10 +478,9 @@ class Retracer:
# On release our reference when we reach Release() == 0 call in the
# trace.
if method.name == 'Release':
- print ' if (call.ret->toUInt()) {'
- print ' return;'
+ print ' if (call.ret->toUInt() == 0) {'
+ print ' retrace::delObj(call.arg(0));'
print ' }'
- print ' retrace::delObj(call.arg(0));'
arg_names = ", ".join(method.argNames())
if method.type is not stdapi.Void: