From 3a3a0aa7fa9e32e3b166614e44561ab8ee4d6ac8 Mon Sep 17 00:00:00 2001 From: Edison Hua Date: Wed, 4 Apr 2018 20:40:53 -0400 Subject: [PATCH] ObjRelease() causing crashes Sometimes and sometimes not. Only on WIndows 7. --- lib/Vis2.ahk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Vis2.ahk b/lib/Vis2.ahk index e5ec3fc..8a116b8 100644 --- a/lib/Vis2.ahk +++ b/lib/Vis2.ahk @@ -2312,7 +2312,7 @@ class Vis2 { DllCall("GlobalUnlock", "ptr",hData) DllCall(NumGet(NumGet(pStream + 0, 0, "uptr") + (A_PtrSize * 2), 0, "uptr"), "ptr",pStream) DllCall("GlobalFree", "ptr",hData) - ObjRelease(pStream) + ;ObjRelease(pStream) DllCall("Crypt32.dll\CryptBinaryToString", "ptr",&Bin, "uint",nSize, "uint",0x01, "ptr",0, "uint*",base64Length) VarSetCapacity(base64, base64Length*2, 0) @@ -2445,7 +2445,7 @@ class Vis2 { DllCall("GlobalUnlock", "ptr",hData) DllCall(NumGet(NumGet(pStream + 0, 0, "uptr") + (A_PtrSize * 2), 0, "uptr"), "ptr",pStream) DllCall("GlobalFree", "ptr",hData) - ObjRelease(pStream) + ;ObjRelease(pStream) DllCall("Crypt32.dll\CryptBinaryToString", "ptr",&Bin, "uint",nSize, "uint",0x01, "ptr",0, "uint*",base64Length) VarSetCapacity(base64, base64Length*2, 0) @@ -2455,7 +2455,7 @@ class Vis2 { VarSetCapacity(base64, -1) } else { DllCall("gdiplus\GdipCreateBitmapFromStream", "ptr",pStream, "uptr*",pBitmap) - ObjRelease(pStream) + ;ObjRelease(pStream) (crop) ? Vis2.stdlib.Gdip_CropBitmap(pBitmap, crop) : "" base64 := Vis2.stdlib.Gdip_EncodeBitmapTo64string(pBitmap, extension, quality) Gdip_DisposeImage(pBitmap)