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
|
||||
when defined(windows):
|
||||
when useWinUnicode:
|
||||
var buf = cast[WideCString](alloc(256*2))
|
||||
var buf = newWideCString("", 256)
|
||||
var len = getModuleFileNameW(0, buf, 256)
|
||||
result = buf$len
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue