We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 67939ef commit b26d95cCopy full SHA for b26d95c
1 file changed
webui.nim
@@ -54,15 +54,21 @@ proc encode*(str: string): string =
54
##
55
## :str: The string to encode.
56
57
- $ bindings.encode(cstring str)
+ var cstr = bindings.encode(cstring str)
58
+ result = $cstr
59
+
60
+ bindings.free(addr cstr)
61
62
proc decode*(str: string): string =
63
## Base64 decoding. Use this to safely decode received Base64 text from the UI.
64
## If it fails it will return an empty string.
65
66
## :str: The string to decode.
67
- $ bindings.decode(cstring str)
68
+ var cstr = bindings.decode(cstring str)
69
70
71
72
73
# ------- Impl funcs --------
74
0 commit comments