Removed error returns from Window.Show() and Window.Hide(). Also properly locked the Window's mutex lock in both functions.

This commit is contained in:
Pietro Gagliardi 2014-03-09 21:47:22 -04:00
parent c4d9e6b956
commit 3ed9c0b75d
1 changed files with 10 additions and 12 deletions

View File

@ -99,19 +99,17 @@ func (w *Window) Open(control Control) (err error) {
} }
// Show shows the window. // Show shows the window.
func (w *Window) Show() (err error) { func (w *Window) Show() {
err = w.sysData.show() w.lock.Lock()
if err != nil { defer w.lock.Unlock()
return fmt.Errorf("error showing window: %v", err)
} w.sysData.show()
return nil
} }
// Hide hides the window. // Hide hides the window.
func (w *Window) Hide() (err error) { func (w *Window) Hide() {
err = w.sysData.hide() w.lock.Lock()
if err != nil { defer w.lock.Unlock()
return fmt.Errorf("error hiding window: %v", err)
} w.sysData.hide()
return nil
} }