From cc8c268dcd913a9d6b29c9790fdb0c240ccd2ec5 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 23 Jan 2006 03:00:35 +0000 Subject: [PATCH] less segv's SVN revision: 19977 --- legacy/emotion/src/lib/emotion_smart.c | 9 ++++++--- legacy/emotion/src/modules/emotion_xine.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/legacy/emotion/src/lib/emotion_smart.c b/legacy/emotion/src/lib/emotion_smart.c index d7ff42b68f..f66bb562a1 100644 --- a/legacy/emotion/src/lib/emotion_smart.c +++ b/legacy/emotion/src/lib/emotion_smart.c @@ -131,7 +131,7 @@ _emotion_module_close(Emotion_Video_Module *mod, void *video) handle = mod->handle; module_close = dlsym(handle, "module_close"); - if (module_close) module_close(mod, video); + if ((module_close) && (video)) module_close(mod, video); dlclose(handle); } @@ -190,6 +190,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file) if ((file) && (file[0] != 0)) { int w, h; + sd->file = strdup(file); if (sd->module) { @@ -210,6 +211,7 @@ emotion_object_file_set(Evas_Object *obj, const char *file) { sd->module->file_close(sd->video); sd->video = NULL; + printf("VIDEO -> NULL\n"); evas_object_image_size_set(sd->obj, 0, 0); } } @@ -1023,7 +1025,7 @@ _pixels_get(void *data, Evas_Object *obj) rows, &rows[ps.h], &rows[ps.h + (ps.h / 2)])) - evas_object_image_pixels_import(obj, &ps); + evas_object_image_pixels_import(obj, &ps); evas_object_image_pixels_dirty_set(obj, 0); free(ps.rows); } @@ -1088,8 +1090,9 @@ _smart_del(Evas_Object * obj) Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return; + printf("DEL: sd->video = %p\n", sd->video); if (sd->video) sd->module->file_close(sd->video); - if (sd->module) _emotion_module_close(sd->module, sd->video); + _emotion_module_close(sd->module, sd->video); evas_object_del(sd->obj); if (sd->file) free(sd->file); if (sd->job) ecore_job_del(sd->job); diff --git a/legacy/emotion/src/modules/emotion_xine.c b/legacy/emotion/src/modules/emotion_xine.c index cda2b5dc62..a909dcfbac 100644 --- a/legacy/emotion/src/modules/emotion_xine.c +++ b/legacy/emotion/src/modules/emotion_xine.c @@ -360,7 +360,7 @@ em_file_close(void *ef) Emotion_Xine_Video *ev; ev = (Emotion_Xine_Video *)ef; - + if (!ev) return; printf("EX pause end...\n"); if (!emotion_object_play_get(ev->obj)) // if (xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE)