Skip to content

Commit

Permalink
Bugfix: ObjRelease()
Browse files Browse the repository at this point in the history
  • Loading branch information
iseahound authored Apr 5, 2018
1 parent 9b18bf8 commit 72698e8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Vis2.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 72698e8

Please sign in to comment.