From 1033427265f0172223028e08ded4b1ea8c98c5a6 Mon Sep 17 00:00:00 2001
From: Thomas Goyne <plorkyeran@aegisub.org>
Date: Sat, 4 Jul 2009 01:46:06 +0000
Subject: [PATCH] Made the edit box only retain its internal undo history for
 changes made since the last commit or line switch rather than every state it
 has had since the program was started, fixing a gradual memory leak.

Originally committed to SVN as r3097.
---
 aegisub/src/subs_edit_box.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp
index 1998ac5f0..ce11f8cde 100644
--- a/aegisub/src/subs_edit_box.cpp
+++ b/aegisub/src/subs_edit_box.cpp
@@ -304,6 +304,8 @@ void SubsEditBox::Update (bool timeOnly,bool weak) {
 			// Video
 			VideoContext::Get()->curLine = curdiag;
 			VideoContext::Get()->UpdateDisplays(false);
+
+			TextEdit->EmptyUndoBuffer();
 		}
 		else enabled = false;
 	}
@@ -375,6 +377,8 @@ void SubsEditBox::SetToLine(int n,bool weak) {
 			if (cur) VideoContext::Get()->JumpToFrame(VFR_Output.GetFrameAtTime(cur->Start.GetMS(),true));
 		}
 	}
+
+	TextEdit->EmptyUndoBuffer();
 }
 
 
-- 
GitLab