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:
IntegratedQuantum 2025-06-01 14:48:44 +02:00
parent beed67403e
commit 4dc994ae9d

View File

@ -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();