# HG changeset patch # User John W. Eaton # Date 1289981043 18000 # Node ID fe11e2b9d48a7054d62dfbdfe1f9b6cb6cbf652d # Parent 795c97ace02c1215a62e88ab812769fadf2f1d29 eliminate text engine memory leak diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -5043,6 +5043,8 @@ #endif box = text_renderer.get_extent (elt, get_rotation ()); + delete elt; + Matrix ext (1, 4, 0.0); // FIXME: also handle left and bottom components diff --git a/src/txt-eng.h b/src/txt-eng.h --- a/src/txt-eng.h +++ b/src/txt-eng.h @@ -179,6 +179,11 @@ ~text_parser_none (void) { } + // FIXME: is it possible to use reference counting to manage the + // memory for the object returned by the text parser? That would be + // preferable to having to know when and where to delete the object it + // creates... + text_element* parse (const std::string& s) { return new text_element_string (s);