By passing autodel=false to class EvasObject, this allows us to wrap
an Evas_Object* where the underlying pointer lifetime is managed by
some other internal object, hence telling the EvasObject instance to
avoid deleting the underlying pointer when the EvasObject itself is
destroyed.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
#include "evasobject.h"
#include "common/test.h"
-EvasObject::EvasObject(Evas_Object* o)
+EvasObject::EvasObject(Evas_Object* o, bool autodel)
: obj_(o)
+ , autodel_(autodel)
{
return;
}
EvasObject::~EvasObject()
{
- if (obj_)
+ if (obj_ and autodel_)
{
evas_object_del(obj_);
}
class EvasObject
{
public:
- EvasObject(Evas_Object* = NULL);
+ EvasObject(Evas_Object* = NULL, bool autodel = true);
virtual ~EvasObject();
private:
Evas_Object* obj_;
-
+ bool autodel_;
};
#endif