# HG changeset patch # User John W. Eaton # Date 1289981043 18000 # Node ID fe11e2b9d48a7054d62dfbdfe1f9b6cb6cbf652d # Parent 795c97ace02c1215a62e88ab812769fadf2f1d29 eliminate text engine memory leak diff -r 795c97ace02c -r fe11e2b9d48a src/graphics.cc --- a/src/graphics.cc Wed Nov 17 02:40:43 2010 -0500 +++ b/src/graphics.cc Wed Nov 17 03:04:03 2010 -0500 @@ -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 -r 795c97ace02c -r fe11e2b9d48a src/txt-eng.h --- a/src/txt-eng.h Wed Nov 17 02:40:43 2010 -0500 +++ b/src/txt-eng.h Wed Nov 17 03:04:03 2010 -0500 @@ -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);