[Hdrflow-svn] SF.net SVN: hdrflow: [345] trunk/lib/openlibraries/src/openpluginlib/pl
Status: Pre-Alpha
Brought to you by:
glslang
From: <gl...@us...> - 2007-10-06 11:33:33
|
Revision: 345 http://hdrflow.svn.sourceforge.net/hdrflow/?rev=345&view=rev Author: glslang Date: 2007-10-06 04:32:43 -0700 (Sat, 06 Oct 2007) Log Message: ----------- + fixes memory leak in opl Modified Paths: -------------- trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.cpp trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.hpp trunk/lib/openlibraries/src/openpluginlib/pl/opl_importer.cpp Modified: trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.cpp =================================================================== --- trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.cpp 2007-10-03 20:54:17 UTC (rev 344) +++ trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.cpp 2007-10-06 11:32:43 UTC (rev 345) @@ -53,6 +53,11 @@ handler_.endElement = opl_endElement; } +content_handler_libxml::~content_handler_libxml( ) +{ + xmlCleanupParser( ); +} + // actions::opl_parser_action& content_handler_libxml::get_action( ) { return action_; } Modified: trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.hpp =================================================================== --- trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.hpp 2007-10-03 20:54:17 UTC (rev 344) +++ trunk/lib/openlibraries/src/openpluginlib/pl/content_handler_libxml.hpp 2007-10-06 11:32:43 UTC (rev 345) @@ -18,10 +18,11 @@ { public: explicit content_handler_libxml( ); + ~content_handler_libxml( ); - actions::opl_parser_action& get_action( ); - xmlSAXHandler* get_content_handler( ); - void set_branch_path( const boost::filesystem::path& branch_path ); + actions::opl_parser_action& get_action( ); + xmlSAXHandler* get_content_handler( ); + void set_branch_path( const boost::filesystem::path& branch_path ); private: actions::opl_parser_action action_; Modified: trunk/lib/openlibraries/src/openpluginlib/pl/opl_importer.cpp =================================================================== --- trunk/lib/openlibraries/src/openpluginlib/pl/opl_importer.cpp 2007-10-03 20:54:17 UTC (rev 344) +++ trunk/lib/openlibraries/src/openpluginlib/pl/opl_importer.cpp 2007-10-06 11:32:43 UTC (rev 345) @@ -58,7 +58,7 @@ hr = pSAXReader->parseURL( ( unsigned short* ) to_wstring( file.native_file_string( ).c_str( ) ).c_str( ) ); assert( SUCCEEDED( hr ) && L"openpluginlib::opl_importer::opl_importer:operator( ) parseURL failed." ); #else - content_handler_libxml* ch = new content_handler_libxml( ); + std::auto_ptr<content_handler_libxml> ch( new content_handler_libxml( ) ); ch->set_branch_path( file.branch_path( ) ); if( xmlSAXUserParseFile( ch->get_content_handler( ), &ch->get_action( ), file.native_file_string( ).c_str( ) ) < 0 ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |