~eliasnaur/gio

f3d75f38a9246c201a2e2a241c9c7c18131c7d9d — Elias Naur 2 months ago 217f3f4
app/internal/wm: [macOS/iOS] don't release nil strings in nsstringToString

Fixes gio#210

Signed-off-by: Elias Naur <mail@eliasnaur.com>
1 files changed, 3 insertions(+), 0 deletions(-)

M app/internal/wm/os_darwin.go
M app/internal/wm/os_darwin.go => app/internal/wm/os_darwin.go +3 -0
@@ 76,6 76,9 @@ func gio_dispatchMainFuncs() {
// nsstringToString converts a NSString to a Go string, and
// releases the original string.
func nsstringToString(str C.CFTypeRef) string {
	if str == 0 {
		return ""
	}
	defer C.CFRelease(str)
	n := C.gio_nsstringLength(str)
	if n == 0 {