1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builtin: fix leak in rune.str(), fix leaks in most assert x == y statements in tests (#11091)

This commit is contained in:
Delyan Angelov
2021-08-13 18:37:34 +03:00
committed by GitHub
parent 0bd68bf5a2
commit 34d39ccb64
15 changed files with 152 additions and 22 deletions

View File

@ -60,7 +60,7 @@ pub fn (mut cb Clipboard) get_text() string {
return ''
}
utf8_clip := C.darwin_get_pasteboard_text(cb.pb)
return unsafe { utf8_clip.vstring() }
return unsafe { tos_clone(&byte(utf8_clip)) }
}
// new_primary returns a new X11 `PRIMARY` type `Clipboard` instance allocated on the heap.