<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1501083649601_3662">Folks,</div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3661">I have an application that I'm supporting and it has a memory leak involving Win32::OLE.    The only thing that clears up the memory leak is stopping the Perl application and restarting it.  But, there has got to be a way to clean up the process at run-time if stopping the Perl process cleans it up. right? Is there possibly a way to unload Win32::OLE and then re-load it?  This is the high level process but for some reason the DLL is not cleaning up on object destruction like it should.  Has anyone worked with this kind of thing before?</div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3661"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3661">Simplified code...</div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3661"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3735">my $report   = Win32::OLE->new($class) or die(sprintf("Error: %s. Cannot create object for class %s.", Win32::OLE->LastError, $class));</div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3735"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3771">$rpt->Export($ext, $filename); #Method from dll<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3814"><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3852"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3852">$report = undef; #code in DLL is supposed to clean up itself when it goes out of scope<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3853"><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3887"><br></div></div></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3814">Thanks,<br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3736">Mike</div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3736"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1501083649601_3736">CPAN: mrdvt</div></div></body></html>