From f7c435b33ec98da01ef6dd8d7d8a7b4c599e767f Mon Sep 17 00:00:00 2001 From: bert Date: Sun, 13 Mar 2016 16:42:40 +0100 Subject: [PATCH] Uninit paste buffers. Signed-off-by: bert --- src/buffer.c | 12 ++++++++++++ src/buffer.h | 1 + src/main.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/src/buffer.c b/src/buffer.c index c58100bbdc..a60ff81387 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1406,6 +1406,18 @@ InitBuffers (void) } void +UninitBuffers (void) +{ + int i; + + for (i = 0; i < MAX_BUFFER; i++) + { + ClearBuffer (Buffers+i); + free (Buffers[i].Data); + } +} + +void SwapBuffers (void) { int i; diff --git a/src/buffer.h b/src/buffer.h index 9b6858adc3..3715371f70 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -50,6 +50,7 @@ void SelectPasteBuffer (int); void SwapBuffers (void); void MirrorBuffer (BufferType *); void InitBuffers (void); +void UninitBuffers (void); void *MoveObjectToBuffer (DataType *, DataType *, int, void *, void *, void *); void *CopyObjectToBuffer (DataType *, DataType *, int, void *, void *, void *); diff --git a/src/main.c b/src/main.c index 3920c8df1a..b219a6ff4e 100644 --- a/src/main.c +++ b/src/main.c @@ -1877,6 +1877,8 @@ char *program_directory = 0; void pcb_main_uninit (void) { + UninitBuffers (); + FreePCBMemory (PCB); if (gui->uninit != NULL) -- 2.11.4.GIT