aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOx Cart2015-02-15 22:47:42 -0600
committerOx Cart2015-02-15 22:47:42 -0600
commit39af7d29d2d62a510959f0aaff44283d065bcbfa (patch)
tree7d555916e2572a1a1bc8f4586ae2635ee40a9ec4
parent56bd82c38ead197ae2e3de0b3c2d77a40106ce44 (diff)
downloadsystray-39af7d29d2d62a510959f0aaff44283d065bcbfa.tar.bz2
Added comment to strPtr
-rw-r--r--systray_windows.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/systray_windows.go b/systray_windows.go
index 0ece157..f7d30d7 100644
--- a/systray_windows.go
+++ b/systray_windows.go
@@ -130,7 +130,9 @@ func addOrUpdateMenuItem(item *MenuItem) {
noop(u16b)
}
-// strPrt converts a Go string into a wchar_t*
+// strPrt converts a Go string into a wchar_t*. It returns the underlying UTF-16
+// array, which needs to be referenced until after it's been passed to the DLL
+// to avoid it being garbage collected.
func strPtr(s string) ([]uint16, uintptr, error) {
u16, err := syscall.UTF16FromString(s)
if err != nil {