DaProgrammer Posted October 5, 2007 Share Posted October 5, 2007 What can couse a memory leak in a script ? i declared all the Var's and all Func vars are local i even placed Var = Func to make sure the return value (not needed) doesnt leak so what can it be ? my program keeps getting bigger and bigger in the taskmanager mem usage Link to comment Share on other sites More sharing options...
weaponx Posted October 5, 2007 Share Posted October 5, 2007 We need some sample code. We cannot predict what is happening. Link to comment Share on other sites More sharing options...
Alek Posted October 5, 2007 Share Posted October 5, 2007 (edited) What can couse a memory leak in a script ?i declared all the Var's and all Func vars are locali even placed Var = Func to make sure the return value (not needed) doesnt leak so what can it be ?my program keeps getting bigger and bigger in the taskmanager mem usagemaybe if we could see your script or a sample script we could help.Edit: damn, to slow Edited October 5, 2007 by Alek [font="Impact"]Never fear, I is here.[/font] Link to comment Share on other sites More sharing options...
DaProgrammer Posted October 6, 2007 Author Share Posted October 6, 2007 We need some sample code. We cannot predict what is happening.here its in "Example scripts" Link to comment Share on other sites More sharing options...
weaponx Posted October 8, 2007 Share Posted October 8, 2007 Here is what I tried: expandcollapse popup#Include <A3LGDIPlus.au3> #Include "FileListToArrayEX.au3" #include <Array.au3> $Folder = IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "folder", "") $Sleep = Number(IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "time_in_ms", 1000)) $pictureArray = _FileListToArrayEx($Folder, '*.jpg;*.bmp', 1, '', False) ;_ArrayDisplay($pictureArray) HotKeySet("+!^w", "_ChangeWallpaper") While 1 If IniRead(@ScriptDir & "\Data.ini", "Wallpaper", "Slide", "") = "True" Then _ChangeWallpaper() EndIf Sleep($Sleep) WEnd Func _ChangeWallpaper() RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '2') ;Randomize next wallpaper instead of grabbing next one $CurrentFile = $Folder & $pictureArray[Random(1,$pictureArray[0], 1)] ;If file is jpg, convert to bmp and store in temp directory Switch StringRight($CurrentFile, 3) Case "jpg" $result = _GDIP_StartUp() If NOT $result Then MsgBox(0,"","Error calling _GDIP_StartUp()") Exit EndIf $hImage = _GDIP_ImageLoadFromFile ($CurrentFile) $sCLSID = _GDIP_EncodersGetCLSID ("BMP") If $sCLSID Then MsgBox(0,"","Error retrieving clsid") _GDIP_ImageSaveToFileEx ($hImage, @TempDir & "\999.bmp", $sCLSID) _GDIP_ShutDown () $CurrentFile = @TempDir & "\999.bmp" Case "bmp" ;Do nothing EndSwitch RegWrite('HKCU\Control Panel\Desktop', 'Wallpaper', 'reg_sz', $CurrentFile) DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $CurrentFile, "int", 0) TrayTip ( "Wallpaper", "Changed to " & $CurrentFile, 10) EndFunc But there is always an error calling _GDIP_StartUp() despite running a fully updated copy of XP Pro Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now