Sub viewer should not get pid using screen image object.
Change-Id: I4f12cb2c1f8f96575a81f1e8a5665ff7f52fba09
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
(cherry picked from commit
29c85c12a9d6c42860fe64abf485c5beb67b6cdc)
EXPORT_API int screen_connector_watcher_evas_get_pid(Evas_Object *obj, int *pid)
{
screen_connector_watcher_evas_h watcher_evas_h;
+ int watcher_pid;
watcher_evas_h = (screen_connector_watcher_evas_h)g_hash_table_lookup(__watcher_tbl, obj);
if (!watcher_evas_h) {
LOGE("unknown object. not widget object");
return -1;
}
- *pid = screen_connector_watcher_get_pid(watcher_evas_h->watcher_h);
+
+ watcher_pid = screen_connector_watcher_get_pid(watcher_evas_h->watcher_h);
+ if (watcher_pid == 0) {
+ LOGE("Invalid object");
+ return -1;
+ }
+
+ *pid = watcher_pid;
return 0;
}