On Aug 20, 1:02 pm, Masaki Suketa <masaki.suk... / nifty.ne.jp> wrote: > Hello, > In message "Re: Won't WIN32OLE_EVENT.new leak?" > on 07/08/20, "nikolai.weib... / gmail.com" <nikolai.weib... / gmail.com> writes: > > > > > Won't WIN32OLE_EVENT.new leak? A WIN32OLE object will sooner or later > > > > be freed (right?), when garbage collection kicks in. But a > > > > WIN32OLE_EVENT object will never be freed, as it is kept in a global > > > > array and is never removed from that array. > > > > WIN32OLE_EVENT object is freed when ruby process terminated. > > > And while ruby process running WIN32OLE_EVENT object is not freed. > > > > Because WIN32OLE_EVENT object should not be freed until > > > WIN32OLE object is freed. > > > Can't the WIN32OLE_EVENT object be linked to the WIN32OLE object so > > that when the WIN32OLE object is freed, we make sure WIN32OLE_EVENT is > > freed as well? > > Thank you. It seems to me that your suggestion is good solution. > I'd like to study this solution. > (I need some time to study.) OK. I'll see if I can come up with a patch as well. I solved the problem for my project by doing everything in a separate process, which would have been easier if Windows supported fork(), but I guess one can't get everything one wants... nikolai