--- parser3/src/classes/date.C 2024/09/13 04:01:22 1.116 +++ parser3/src/classes/date.C 2024/11/10 20:33:21 1.119 @@ -1,7 +1,7 @@ /** @file Parser: @b date parser class. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ @@ -14,7 +14,7 @@ #include "pa_vtable.h" #include "pa_vbool.h" -volatile const char * IDENT_DATE_C="$Id: date.C,v 1.116 2024/09/13 04:01:22 moko Exp $" IDENT_PA_VDATE_H; +volatile const char * IDENT_DATE_C="$Id: date.C,v 1.119 2024/11/10 20:33:21 moko Exp $" IDENT_PA_VDATE_H; // class @@ -43,8 +43,12 @@ public: } }; - -Table date_calendar_table_template(new Date_calendar_table_template_columns); +static Table &date_calendar_table_template(){ + static Table *singleton=NULL; + if(singleton==NULL) + singleton=new Table(new Date_calendar_table_template_columns); + return *singleton; +} // methods @@ -394,7 +398,7 @@ static void _roll(Request& r, MethodPara static Table& fill_month_days(Request& r, MethodParams& params, bool rus){ Table::Action_options table_options; - Table& result=*new Table(date_calendar_table_template, table_options); + Table& result=*new Table(date_calendar_table_template(), table_options); tm tmIn; memset(&tmIn, 0, sizeof(tmIn));