From 72698e859ace7ad3118589706ffed4cdfd81e78a Mon Sep 17 00:00:00 2001 From: Edison Hua Date: Wed, 4 Apr 2018 21:30:11 -0400 Subject: [PATCH] Bugfix: ObjRelease() --- lib/Vis2.ahk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Vis2.ahk b/lib/Vis2.ahk index 4b12d8a..e79aff6 100644 --- a/lib/Vis2.ahk +++ b/lib/Vis2.ahk @@ -2314,8 +2314,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) - + DllCall("Crypt32.dll\CryptBinaryToString", "ptr",&Bin, "uint",nSize, "uint",0x01, "ptr",0, "uint*",base64Length) VarSetCapacity(base64, base64Length*2, 0) DllCall("Crypt32.dll\CryptBinaryToString", "ptr",&Bin, "uint",nSize, "uint",0x01, "ptr",&base64, "uint*",base64Length) @@ -2447,7 +2446,6 @@ 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) DllCall("Crypt32.dll\CryptBinaryToString", "ptr",&Bin, "uint",nSize, "uint",0x01, "ptr",0, "uint*",base64Length) VarSetCapacity(base64, base64Length*2, 0) @@ -2457,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)