Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you're using CComPtr then that's generally the main thing I'd advise, but I did find something that might help, if you're using Visual Studio.</p> <p>Sara Fords blog has a really cool tip:</p> <p><a href="http://saraford.net/2005/05/03/did-you-know-how-to-debug-addrefrelease-issues-in-visual-studio/" rel="nofollow">Debugging AddRef/Release issues in VS</a></p> <p>You might get a <em>lot</em> of information logged, but the basic idea is to trace your addref/release calls in Visual Studio and you can look for mismatched pairs of AddRef/Release.</p> <p>Might be a bit of legwork but it looks like quite a cunning idea.</p> <p>Edit 2: Good morning;</p> <p>Ok, if you're not using DllGetClassObject then that's not going to be a reference problem. Using IUknowns as in/out parameters <em>does</em> have a caveat though; This is the blurb from MSDN for AddRef:</p> <blockquote> <p>Call this method for every new copy of an interface pointer that you make. For example, if you are passing a copy of a pointer back from a method, you must call AddRef on that pointer. You must also call AddRef on a pointer before passing it as an in-out parameter to a method; the method will call IUnknown::Release before copying the out-value on top of it.</p> </blockquote> <p>Similarly for release:</p> <blockquote> <p>Call this method when you no longer need to use an interface pointer. If you are writing a method that takes an in-out parameter, call Release on the pointer you are passing in before copying the out-value on top of it.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload