let ecore_evas_ecore_evas_get() be safer.

SVN revision: 59759
This commit is contained in:
Gustavo Sverzut Barbieri 2011-05-27 18:53:27 +00:00
parent 69e89c2666
commit a2e1a187e6
1 changed files with 9 additions and 2 deletions

View File

@ -832,12 +832,19 @@ ecore_evas_engine_name_get(const Ecore_Evas *ee)
* Return the Ecore_Evas for this Evas
*
* @param e The Evas to get the Ecore_Evas from
* @return The Ecore_Evas that holds this Evas
* @return The Ecore_Evas that holds this Evas, or NULL if not hold by one.
*/
EAPI Ecore_Evas *
ecore_evas_ecore_evas_get(const Evas *e)
{
return evas_data_attach_get(e);
Ecore_Evas *ee = evas_data_attach_get(e);
if (!ee) return NULL;
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS, "ecore_evas_ecore_evas_get");
return NULL;
}
return ee;
}
/**