mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-30 22:13:54 +00:00
update clipboard error hand Fixed #212
This commit is contained in:
parent
1aff63a651
commit
31a5c61264
@ -99,6 +99,7 @@ func writeAll(text string) error {
|
||||
if h == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if h != 0 {
|
||||
globalFree.Call(h)
|
||||
@ -116,17 +117,17 @@ func writeAll(text string) error {
|
||||
}
|
||||
|
||||
r, _, err = globalUnlock.Call(h)
|
||||
if r == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
r, _, err = setClipboardData.Call(cfUnicodetext, h)
|
||||
if r == 0 {
|
||||
if err.(syscall.Errno) != 0 {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
r, _, err = setClipboardData.Call(cfUnicodetext, h)
|
||||
if r == 0 {
|
||||
return err
|
||||
}
|
||||
|
||||
h = 0 // suppress deferred cleanup
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user