Paul J. Lucas has proposed merging lp:~paul-lucas/zorba/bug-944797 into 
lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  Paul J. Lucas (paul-lucas)
Related bugs:
  Bug #944797 in Zorba: "Memory leak of tokenizers in simple store"
  https://bugs.launchpad.net/zorba/+bug/944797

For more details, see:
https://code.launchpad.net/~paul-lucas/zorba/bug-944797/+merge/95561

Added ~XmlNodeTokenizerCallback() to destroy tokenizers.
-- 
https://code.launchpad.net/~paul-lucas/zorba/bug-944797/+merge/95561
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'src/store/naive/node_items.cpp'
--- src/store/naive/node_items.cpp	2012-02-28 20:45:43 +0000
+++ src/store/naive/node_items.cpp	2012-03-02 13:52:59 +0000
@@ -43,6 +43,7 @@
 #include "dataguide.h"
 #include "node_factory.h"
 
+#include "util/stl_util.h"
 #include "util/string_util.h"
 
 #ifndef ZORBA_NO_FULL_TEXT
@@ -4638,6 +4639,13 @@
 }
 
 
+XmlNodeTokenizerCallback::~XmlNodeTokenizerCallback()
+{
+  while ( !tokenizer_stack_.empty() )
+    ztd::pop_stack( tokenizer_stack_ )->destroy();
+}
+
+
 inline XmlNodeTokenizerCallback::begin_type
 XmlNodeTokenizerCallback::beginTokenization() const 
 {

=== modified file 'src/store/naive/node_items.h'
--- src/store/naive/node_items.h	2012-02-28 20:45:43 +0000
+++ src/store/naive/node_items.h	2012-03-02 13:52:59 +0000
@@ -1666,6 +1666,8 @@
                             locale::iso639_1::type lang,
                             container_type &tokens );
 
+  ~XmlNodeTokenizerCallback();
+
   begin_type beginTokenization() const;
 
   void endTokenization( XmlNode const*, begin_type );

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to