From 024c83a13a256f7f171732189a154c74c0ce24ad Mon Sep 17 00:00:00 2001 From: Teddy Date: Mon, 19 Aug 2013 00:20:11 +0800 Subject: fix a severe bug : copy-constructor expected in EvalObj --- model.cpp | 5 +++++ model.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/model.cpp b/model.cpp index e454c72..6fd41b3 100644 --- a/model.cpp +++ b/model.cpp @@ -27,6 +27,11 @@ bool FrameObj::is_parse_bracket() { return ftype & CLS_PAR_BRA; } +EvalObj::EvalObj(const EvalObj &src) : +FrameObj(CLS_EVAL_OBJ), otype(src.otype) { + gc_rec = gc.join(this); +} + EvalObj::EvalObj(int _otype) : FrameObj(CLS_EVAL_OBJ), otype(_otype) { /** To notify GC when an EvalObj is constructed */ diff --git a/model.h b/model.h index 2e029c0..63f48be 100644 --- a/model.h +++ b/model.h @@ -72,6 +72,8 @@ class EvalObj : public FrameObj {/*{{{*/ * CLS_SIM_OBJ for a simple object), which defaults to CLS_SIM_OBJ, etc. */ EvalObj(int otype = CLS_SIM_OBJ); + /** The copy constructor */ + EvalObj(const EvalObj &src); /** * The destructor */ -- cgit v1.2.3-70-g09d2