[Q] WIN32OLE memory leaks

C

Chuck Remes

I should have noted that the code snippet comes from ruby 1.9.1 p-376.

I have discovered the root cause of this problem. The good news is that it isn't a problem with the Ruby WIN32OLE implementation.

I don't know if all COM servers work this way, but the specific application I am using memory-maps all WIN32OLE_EVENT data parameters. The space consumed by this memory-mapped data is registered in the ruby process and not against the COM server.

Since COM objects do memory management via reference counting, I had to specifically release the data given to my event callbacks. I didn't know this was a required step (the COM server API docs are silent on this issue) so I was slowly leaking these references every time my event callbacks were fired. I have now corrected my misuse of this COM server's API and all is well.

cr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,951
Messages
2,570,113
Members
46,698
Latest member
alexxx

Latest Threads

Top