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.
# 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:
IUnknown.methods = (
StdMethod(HRESULT, "QueryInterface", ((REFIID, "riid"), Out(Pointer(ObjPointer(Void)), "ppvObj"))),
- StdMethod(ULONG, "AddRef", (), sideeffects=False),
+ StdMethod(ULONG, "AddRef", ()),
StdMethod(ULONG, "Release", ()),
)