fixes memory leak for getAppFilename on Windows
This commit is contained in:
parent
85345d2d34
commit
22ed2aab35
1 changed files with 1 additions and 1 deletions
|
|
@ -1361,7 +1361,7 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [ReadIOEffect].} =
|
||||||
# /proc/<pid>/file
|
# /proc/<pid>/file
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
when useWinUnicode:
|
when useWinUnicode:
|
||||||
var buf = cast[WideCString](alloc(256*2))
|
var buf = newWideCString("", 256)
|
||||||
var len = getModuleFileNameW(0, buf, 256)
|
var len = getModuleFileNameW(0, buf, 256)
|
||||||
result = buf$len
|
result = buf$len
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue