On Thu, 31 Mar 2011 05:07:01 +0000 (GMT) 박지연 <jy0703.p...@samsung.com> said:
made all the widgets use a standard macro now in svn :) > > Dear All. > I'm Jiyoun park. > > Yesterday, I found some code which cause memory leak in elementary. > some elementary check parent's evas after alloc memory in elm_XXX_add > function like below. > > > ... > wd = ELM_NEW(Widget_Data); ======> alloc memory > e = evas_object_evas_get(parent); > if (!e) return NULL; =======> It is almost impossible to return here. > But if that case occured, memory leak happened. ...... > > So how about moving alloc code after checking parent's evas like below? > > ... > e = evas_object_evas_get(parent); > if (!e) return NULL; > wd = ELM_NEW(Widget_Data); =====> alloc memory after check > ... > > If this opinion is acceptable, I can make patch for this. > Below is the elementary list which checking evas after alloc memory. > > thanks. > > <========List ===========> > elementary list > elm_anchorblock_add > elm_anchorview_add > elm_ctxpopup_add > elm_fileselector_button_add > elm_hoversel_add > elm_scrolled_entry_add > elm_actionslider_add > elm_bg_add > elm_box_add > elm_bubble_add > elm_button_add > elm_calendar_add > elm_check_add > elm_clock_add > elm_colorselector_add > elm_conformant_add > elm_controlbar_add > elm_entry_add > elm_flip_add > elm_flipselector_add > elm_frame_add > elm_gengrid_add > elm_genlist_add > elm_hover_add > elm_icon_add > elm_image_add > elm_imageslider_add > elm_index_add > elm_label_add > elm_layout_add > elm_list_add > elm_map_add > elm_mapbuf_add > elm_menu_add > elm_multibuttonentry_add > elm_navigationbar_ex_item_push > elm_notify_add > elm_pager_add > elm_pager_content_push > elm_panel_add > elm_panes_add > elm_photo_add > elm_photocam_add > elm_progressbar_add > elm_radio_add > elm_scroller_add > elm_searchbar_add > elm_segment_control_add > elm_separator_add > elm_slider_add > elm_slideshow_add > elm_slidingdrawer_add > elm_spinner_add > elm_table_add > elm_thumb_add > elm_toggle_add > elm_toolbar_add > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel