seven_shen has asked for the wisdom of the Perl Monks concerning the following question:
I meet per crash problem during global destruction while using WIN32 OLE object in multi thread, here is my code:
use strict; use threads; use threads::shared; our$oleobject; $oleobject=Win32::OLE->new("AutoItX3.Control"); my $aut =threads->new(\&check_popup,"check_popup_thread"); $aut->detach(); MYFunction(); exit(0); sub check_popup { require Win32::OLE; my $name =@_; print $name; while(1) { if($oleobject->WinWait('POPUP','',1); { $oleobject->WinClose('POPUP'); } } }
while when the program exits, perl always crash with notice like:
Free to wrong pool 16435b8 not 537ab18 at <eval 40> line 1 Attemt to free unreferenced scalar: SV0x5488e94,Perl interpreter:0x..... during global destruction.
and still lots of error shows : Win32::OLE<0.1709>:GetOleObeject<> Not a Win32::OLE object at C:/Perl/lib/Win32/OLE/Lite.pm line 154
I appreciate your kind help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl crashs always during global destruction when using WIN32 OLE object in multithread
by Corion (Patriarch) on Mar 03, 2011 at 08:08 UTC | |
by nikosv (Deacon) on Mar 03, 2011 at 12:28 UTC | |
|
Re: Perl crashs always during global destruction when using WIN32 OLE object in multithread
by BrowserUk (Patriarch) on Mar 03, 2011 at 07:29 UTC |