locked
Dispose WinRT C++ components

    Question

  • I have a HTML/JS project that references a WinRT component written in C++. I want to call the destructor of the component in JavaScript to release the resources. The documentation mention something about a Dispose() method in the projection, however I could only find a close() method. This close method seems to be doing what I need, I have checked using the debugger that the destructor is called on invoking close method.

    Just wanted to make sure this is the right method.

    Thanks,
    Valentin


    Valentin Iliescu

    Wednesday, May 30, 2012 11:28 PM

Answers

  • Hi,

    I have not found the related document. But from my experience, you’re correct. If your C++ class has a destructor, it will be invoked when you call close (not dispose) in JavaScript. In C# and C++, however, it is needed to invoke Dispose (not Close).

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework

    Thursday, May 31, 2012 11:00 AM
    Moderator