You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, there is a memory leak already in release 2.6.1. If I output a Sixel image and clear the >scrollback buffer repeatedly (reset), it uses some memory more every time.
Maybe this should be continued in a mintty or mintty-sixel issue rather than here...
I confirmed there are two problems:
term.imgs.parser_state leaks in term_reset() with hard reset(RIS).
winimgs_clear() is not called when IDM_RESET(Alt+F8) is dispatched.
patch:
diff --git a/src/winimg.c b/src/winimg.c
index a1a9b71..19e1e23 100644
--- a/src/winimg.c
+++ b/src/winimg.c
@@ -11,6 +11,7 @@
#include "winpriv.h"
#include "termpriv.h"
#include "winimg.h"
+#include "sixel.h"
// tempfile_t manipulation
@@ -284,6 +285,11 @@ winimgs_clear(void)
{
imglist *img, *prev;
+ // clear parser state
+ sixel_parser_deinit(term.imgs.parser_state);
+ free(term.imgs.parser_state);
+ term.imgs.parser_state = NULL;
+
// clear images in current screen
for (img = term.imgs.first; img; ) {
prev = img;
diff --git a/src/winmain.c b/src/winmain.c
index e808a2e..628d306 100644
--- a/src/winmain.c
+++ b/src/winmain.c
@@ -12,6 +12,7 @@
#include "winpriv.h"
#include "winsearch.h"
+#include "winimg.h"
#include "term.h"
#include "appinfo.h"
@@ -1268,7 +1269,7 @@ static struct {
when IDM_COPY: term_copy();
when IDM_PASTE: win_paste();
when IDM_SELALL: term_select_all(); win_update();
- when IDM_RESET: term_reset(); win_update();
+ when IDM_RESET: winimgs_clear(); term_reset(); win_update();
when IDM_DEFSIZE:
default_size();
when IDM_DEFSIZE_ZOOM:
The text was updated successfully, but these errors were encountered:
Forwarded from saitoha/libsixel#50 (comment).
I confirmed there are two problems:
patch:
The text was updated successfully, but these errors were encountered: