changeset 93:ce016a1b9034

Fix a bug in the test program because it was based on the C code which invalidated the event on close.
author Brian Smith <brian@dbsoft.org>
date Thu, 03 Oct 2013 20:54:15 -0500
parents 019deed896d1
children 63d6eb6fcb17
files src/dw/dw.go src/dwtest/dwtest.go
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/dw/dw.go	Thu Oct 03 14:59:18 2013 -0500
+++ b/src/dw/dw.go	Thu Oct 03 20:54:15 2013 -0500
@@ -4738,12 +4738,14 @@
 }
 
 // Closes a semaphore created by Event_new().
-func Event_close(handle HEV) int {
-    return int(C.go_event_close(unsafe.Pointer(handle.hev)));
+func Event_close(handle *HEV) int {
+    retval := int(C.go_event_close(unsafe.Pointer(handle.hev)));
+    handle.hev = nil;
+    return retval;
 }
 
 // Closes a semaphore created by EventNew().
-func (handle HEV) Close() int {
+func (handle *HEV) Close() int {
     return Event_close(handle);
 }
 
--- a/src/dwtest/dwtest.go	Thu Oct 03 14:59:18 2013 -0500
+++ b/src/dwtest/dwtest.go	Thu Oct 03 20:54:15 2013 -0500
@@ -877,7 +877,7 @@
     finished = dw.TRUE;
     dw.Event_post(workevent);
     /* Close the control event */
-    dw.Event_close(controlevent);
+    dw.Event_close(&controlevent);
     update_mle("Control thread finished.\r\n", dw.TRUE);
     dw.Window_enable(startbutton);
     dw.DeinitThread();