Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

ObjCreate Causes a Memory leak (Updated)

$
0
0
In one of my functions, i need to control a class of Internet Explorer but i found after long periods of time the size of the exe goes up. After doing some testing i found it was because of ObjCreate.

Example Code.
[ autoit ]      
#NoTrayIcon While 1 sleep(250) Make() WEnd Func Make() Local $o_object = ObjCreate("InternetExplorer.Application") $o_object.quit EndFunc

If you open up task manager, you will see the memory for the Autoit.exe goes up steady.

I had hoping, though i dont have a very good understanding of ObjGet, the following would fix my problem.

Retrieves a reference to a COM object from an existing process or filename.
ObjGet ( "filename" [, "classname"] ).

[ autoit ]      
$IEPid = Run('C:\Program Files (x86)\Internet Explorer\iexplore.exe') $IEOb= ObjGet("", "InternetExplorer.Application")

but it doesn't quite work and though a search of the forums didn't yeild a great deal but i did find this.

http://www.autoitscript.com/forum/topic/146333-memory-leak-in-autoit-functions-objcreateobjget/page__hl__objget#entry1035639

Which suggest both fuctions would cause a leak. I have also looked for like a DeleteObj function as well, to clean up the resources but no luck there as well.
Was wondering if anyone had any thoughts.

Viewing all articles
Browse latest Browse all 12506

Trending Articles