mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 03:06:55 -04:00
Remove the text listener while deiniting the component
Previously there was a rare race condition where this could crash. should fix #1562
This commit is contained in:
parent
beed67403e
commit
4dc994ae9d
@ -68,6 +68,10 @@ pub fn init(pos: Vec2f, maxWidth: f32, maxHeight: f32, text: []const u8, onNewli
|
||||
}
|
||||
|
||||
pub fn deinit(self: *const TextInput) void {
|
||||
if(gui.selectedTextInput == self) {
|
||||
gui.setSelectedTextInput(null);
|
||||
}
|
||||
|
||||
self.textBuffer.deinit();
|
||||
self.currentString.deinit();
|
||||
self.scrollBar.deinit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user