Add missing copy ctor for Javascript Code Template class.

This commit is contained in:
Oliver Buchtala 2014-02-28 10:40:41 +01:00
commit 70385842df

View file

@ -86,6 +86,8 @@ public:
Template(const String *code, const String *templateName); Template(const String *code, const String *templateName);
Template(const Template& other);
~Template(); ~Template();
String *str(); String *str();
@ -620,7 +622,6 @@ Template JSEmitter::getTemplate(const String *name) {
} }
Template t(templ, name); Template t(templ, name);
return t; return t;
} }
@ -2441,6 +2442,11 @@ Template& Template::pretty_print(DOH *doh) {
return *this; return *this;
} }
Template::Template(const Template& t) {
code = NewString(t.code);
templateName = NewString(t.templateName);
}
void Template::operator=(const Template& t) { void Template::operator=(const Template& t) {
Delete(code); Delete(code);
Delete(templateName); Delete(templateName);