From: sumanth Date: Fri, 2 Dec 2011 06:49:48 +0000 (+0530) Subject: [elm_clock.c][elm_diskselector.c]prevent warnings are fixed. CID:55299,40070. X-Git-Tag: REL_F_I9500_20111206_1~6^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b838fa60858043c58f1feb39d4a8a8c858219b2;p=framework%2Fuifw%2Felementary.git [elm_clock.c][elm_diskselector.c]prevent warnings are fixed. CID:55299,40070. Change-Id: I4d6f046cdd0a57c233ca4cd6548a7d7e98950498 --- diff --git a/src/lib/elm_clock.c b/src/lib/elm_clock.c index ad8565b..8594134 100644 --- a/src/lib/elm_clock.c +++ b/src/lib/elm_clock.c @@ -142,9 +142,12 @@ _timediff_set(Widget_Data *wd) gettimeofday(&timev, NULL); tt = (time_t)(timev.tv_sec); tzset(); - tm = localtime(&tt); + tm = calloc(1, sizeof(struct tm)); + if (!tm) return; + localtime_r(&tt, tm); wd->timediff = (((wd->hrs - tm->tm_hour) * 60 + wd->min - tm->tm_min) * 60) + wd->sec - tm->tm_sec; + free(tm); } static Eina_Bool @@ -163,14 +166,15 @@ _ticker(void *data) { tt = (time_t)(timev.tv_sec) + wd->timediff; tzset(); - tm = localtime(&tt); - if (tm) - { - wd->hrs = tm->tm_hour; - wd->min = tm->tm_min; - wd->sec = tm->tm_sec; - _time_update(data); - } + tm = calloc(1, sizeof(struct tm)); + if (!tm) return ECORE_CALLBACK_CANCEL; + localtime_r(&tt, tm); + wd->hrs = tm->tm_hour; + wd->min = tm->tm_min; + wd->sec = tm->tm_sec; + _time_update(data); + + free(tm); } return ECORE_CALLBACK_CANCEL; } diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c index cba3012..88e6165 100644 --- a/src/lib/elm_diskselector.c +++ b/src/lib/elm_diskselector.c @@ -231,7 +231,7 @@ _del_pre_hook(Evas_Object * obj) if (it) { eina_stringshare_del(it->label); - evas_object_del(VIEW(wd->first)); + evas_object_del(VIEW(it)); free(it); } } @@ -241,7 +241,7 @@ _del_pre_hook(Evas_Object * obj) if (it) { eina_stringshare_del(it->label); - evas_object_del(VIEW(wd->first)); + evas_object_del(VIEW(it)); free(it); } }