mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-09 14:32:53 +00:00
fixes memory leak for getAppFilename on Windows
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user