summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.c b/main.c
index 8ef9aa2..1157ce4 100644
--- a/main.c
+++ b/main.c
@@ -1,5 +1,5 @@
// @TODO:
-// - when closing tabs/window, warn on unsaved changes
+// - middle click to close tab
// - try opening a file you don't have read permission for -- check for memory leaks!
// - show something informative when there's no nodes open (i.e. ted->active_node == NULL).
@@ -570,9 +570,11 @@ int main(int argc, char **argv) {
SDL_DestroyWindow(window);
SDL_Quit();
for (u16 i = 0; i < TED_MAX_BUFFERS; ++i)
- buffer_free(&ted->buffers[i]);
+ if (ted->buffers_used[i])
+ buffer_free(&ted->buffers[i]);
for (u16 i = 0; i < TED_MAX_NODES; ++i)
- node_free(&ted->nodes[i]);
+ if (ted->nodes_used[i])
+ node_free(&ted->nodes[i]);
buffer_free(&ted->line_buffer);
text_font_free(ted->font);
text_font_free(ted->font_bold);