--- parser3/src/classes/table.C 2005/11/18 11:00:03 1.208.6.6 +++ parser3/src/classes/table.C 2005/11/25 09:52:07 1.217 @@ -4,8 +4,7 @@ Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ - -static const char * const IDENT_TABLE_C="$Date: 2005/11/18 11:00:03 $"; +static const char * const IDENT_TABLE_C="$Date: 2005/11/25 09:52:07 $"; #include "classes.h" #include "pa_vmethod_frame.h" @@ -21,7 +20,7 @@ static const char * const IDENT_TABLE_C= class MTable: public Methoded { public: // VStateless_class - Value* create_new_value(Pool&) { return new VTable(); } + Value* create_new_value(Pool&, HashStringValue&) { return new VTable(); } public: MTable(); @@ -139,7 +138,7 @@ static void _create(Request& r, MethodPa size_t raw_pos_after=0; Table::columns_type columns; if(params.count()==2) { - String& snameless=params.as_string(0, "called with two params, first param may only be string 'nameless'"); + const String& snameless=params.as_string(0, "called with two params, first param may only be string 'nameless'"); if(snameless!="nameless") throw Exception("parser.runtime", &snameless, @@ -447,8 +446,13 @@ static void _save(Request& r, MethodPara } // write - file_write(r.absolute(file_name), - sdata.cstr(), sdata.length(), true, do_append); + { + const char* data_cstr=sdata.cstr(); + file_write(r.absolute(file_name), + data_cstr, sdata.length(), true, do_append); + if(*data_cstr) // not empty (when empty it's not heap memory) + pa_free((void*)data_cstr); // not needed anymore + } } static void _count(Request& r, MethodParams&) {