Bill Roper (billroper) wrote,
Bill Roper

The Dam Has Burst! Run For Your Lives!

It appears that we have a big memory leak in our application. Some of it is my fault, because I copied incorrectly working code without bothering to check how a particular class worked.

Short form: our COM routines return a BSTR. If you assign that BSTR value to an object of the CComBSTR class, the value is copied to the internal storage for the class instead of being attached to the internal storage. So if you were counting on the BSTR being cleaned up when the CComBSTR object went out of scope, well, you were right for one out of two strings.


The solution is to call the Attach method for the CComBSTR class so that it takes ownership of the pointer.

And happily, I figured this out before code freeze.

Now we just need to fix all of the places that are doing it wrong.
Tags: microsoft, musings, work

  • Grouting Away

    The grout is going in. It turns out that there was not *enough* grout, because when you have tile in this style, it takes a *lot* of grout. So when…

  • Sealed Up

    The sealant went onto the stone sections of the backsplash tile today. That leaves the grouting and a good bit of touch up painting, after which the…

  • Very Close To Done

    The tile is now up in the kitchen. It still needs to be sealed and grouted, but it is nearly finished. Then I need to put up the various outlet…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded