When trying to set the text field of an empty TextArea the system crashes with a SIGSEGV
Log:
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui.nim(1012) addLine
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui.nim(2650) addLine
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui.nim(1011) addText
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui.nim(2648) addText
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui.nim(978) text
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui/private/windows/platform_impl.nim(1523) text
/home/chris/.nimble/pkgs/nigui-0.2.4/nigui/private/windows/platform_impl.nim(111) pGetWindowText
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
fixed this locally by adding the following check for characters in the pGetWindowText proc:
proc pGetWindowText(hWnd: pointer): string =
let characters = GetWindowTextLengthW(hWnd)
if characters == 0:
return ""
result = newString(characters * 2)
var res = GetWindowTextW(hWnd, result, characters * 2 + 1)
if res != characters: pRaiseLastOSError()
result = result.pUtf16ToUtf8
Program runs fine on Manjaro, but crashes when running on wine. So the problem seems to be windows specific. After using the fix both versions run without problems.
When trying to set the text field of an empty TextArea the system crashes with a SIGSEGV
Log:
fixed this locally by adding the following check for
characters
in the pGetWindowText proc:Program runs fine on Manjaro, but crashes when running on wine. So the problem seems to be windows specific. After using the fix both versions run without problems.