summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--link_windows_386.go2
-rw-r--r--link_windows_amd64.go2
-rw-r--r--static_windows_386.syso (renamed from static_windows_386.o)bin1308 -> 1308 bytes
-rw-r--r--static_windows_amd64.syso (renamed from static_windows_amd64.o)bin1308 -> 1308 bytes
-rw-r--r--stddialogs.go24
5 files changed, 16 insertions, 12 deletions
diff --git a/link_windows_386.go b/link_windows_386.go
index 3ea6183..f223ae1 100644
--- a/link_windows_386.go
+++ b/link_windows_386.go
@@ -2,7 +2,7 @@
package ui
-// #cgo LDFLAGS: ${SRCDIR}/static_windows_386.o ${SRCDIR}/libui_windows_386.a ${SRCDIR}/libui_windows_386.res.o
+// #cgo LDFLAGS: ${SRCDIR}/libui_windows_386.a ${SRCDIR}/libui_windows_386.res.o
// /* note the order; also note the lack of uuid */
// #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -static -static-libgcc -static-libstdc++
import "C"
diff --git a/link_windows_amd64.go b/link_windows_amd64.go
index 1992ae7..515bbd1 100644
--- a/link_windows_amd64.go
+++ b/link_windows_amd64.go
@@ -2,7 +2,7 @@
package ui
-// #cgo LDFLAGS: ${SRCDIR}/static_windows_amd64.o ${SRCDIR}/libui_windows_amd64.a ${SRCDIR}/libui_windows_amd64.res.o
+// #cgo LDFLAGS: ${SRCDIR}/libui_windows_amd64.a ${SRCDIR}/libui_windows_amd64.res.o
// /* note the order; also note the lack of uuid */
// #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -static -static-libgcc -static-libstdc++
import "C"
diff --git a/static_windows_386.o b/static_windows_386.syso
index 46c6ccc..46c6ccc 100644
--- a/static_windows_386.o
+++ b/static_windows_386.syso
Binary files differ
diff --git a/static_windows_amd64.o b/static_windows_amd64.syso
index eb56b3b..eb56b3b 100644
--- a/static_windows_amd64.o
+++ b/static_windows_amd64.syso
Binary files differ
diff --git a/stddialogs.go b/stddialogs.go
index 7954512..0ff8a01 100644
--- a/stddialogs.go
+++ b/stddialogs.go
@@ -8,30 +8,34 @@ import "C"
// TODO
func MsgBoxError(w *Window, title string, description string) {
ctitle := C.CString(title)
+ defer freestr(ctitle)
cdescription := C.CString(description)
+ defer freestr(cdescription)
C.uiMsgBoxError(w.w, ctitle, cdescription)
- freestr(ctitle)
- freestr(cdescription)
}
func OpenFile(w *Window) string {
cname := C.uiOpenFile(w.w)
- name := C.GoString(cname)
- C.uiFreeText(cname)
- return name
+ if cname == nil {
+ return ""
+ }
+ defer C.uiFreeText(cname)
+ return C.GoString(cname)
}
func SaveFile(w *Window) string {
cname := C.uiSaveFile(w.w)
- name := C.GoString(cname)
- C.uiFreeText(cname)
- return name
+ if cname == nil {
+ return ""
+ }
+ defer C.uiFreeText(cname)
+ return C.GoString(cname)
}
func MsgBox(w *Window, title string, description string) {
ctitle := C.CString(title)
+ defer freestr(ctitle)
cdescription := C.CString(description)
+ defer freestr(cdescription)
C.uiMsgBox(w.w, ctitle, cdescription)
- freestr(ctitle)
- freestr(cdescription)
}