mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-12 05:53:51 -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 {
|
pub fn deinit(self: *const TextInput) void {
|
||||||
|
if(gui.selectedTextInput == self) {
|
||||||
|
gui.setSelectedTextInput(null);
|
||||||
|
}
|
||||||
|
|
||||||
self.textBuffer.deinit();
|
self.textBuffer.deinit();
|
||||||
self.currentString.deinit();
|
self.currentString.deinit();
|
||||||
self.scrollBar.deinit();
|
self.scrollBar.deinit();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user