Eo: error when calling constructor/destructor out of context.

SVN revision: 71900
This commit is contained in:
Tom Hacohen 2012-06-10 14:04:58 +00:00
parent 9c929ba2ed
commit 402bad0186
2 changed files with 12 additions and 0 deletions

View File

@ -1361,6 +1361,12 @@ _eo_error_unset(Eo *obj)
void
_eo_condtor_done(Eo *obj)
{
if (obj->condtor_done)
{
ERR("Object %p is already constructed at this point.", obj);
return;
}
obj->condtor_done = EINA_TRUE;
}

View File

@ -15,6 +15,12 @@ START_TEST(eo_simple)
Eo *obj = eo_add(EO_BASE_CLASS, NULL);
fail_if(obj);
obj = eo_add(SIMPLE_CLASS, NULL);
fail_if(!obj);
eo_do(obj, eo_constructor());
eo_do(obj, eo_destructor());
eo_unref(obj);
eo_shutdown();
}
END_TEST