[widget] Add win destroy logic to tutorial.
authorhyunho kang <hhstark.kang@samsung.com>
Fri, 28 Aug 2015 04:45:34 +0000 (13:45 +0900)
committerhyunho kang <hhstark.kang@samsung.com>
Fri, 28 Aug 2015 07:42:35 +0000 (16:42 +0900)
Change-Id: I2d2388bf25b98db69939328c59542e2c1d281094
Signed-off-by: hyunho kang <hhstark.kang@samsung.com>
org.tizen.tutorials/html/native/app_framework/widget_tutorial_n.htm

index 973fde0..31d3f04 100644 (file)
@@ -330,7 +330,27 @@ widget_instance_create(widget_context_h context, bundle *content, int w, int h,
 &nbsp;&nbsp;&nbsp;widget_app_context_set_tag(context, wid);
 
 &nbsp;&nbsp;&nbsp;return WIDGET_ERROR_NONE;
-} 
+}
+
+int widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e reason, bundle *content, void *user_data)
+{
+
+&nbsp;&nbsp;&nbsp;if (reason != WIDGET_APP_DESTROY_TYPE_PERMANENT)
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Save the current status at the bundle object
+&nbsp;&nbsp;&nbsp;}
+
+&nbsp;&nbsp;&nbsp;widget_instance_data_s *wid = NULL;
+&nbsp;&nbsp;&nbsp;widget_app_context_get_tag(context, (void**)&wid);
+
+&nbsp;&nbsp;&nbsp;if (wid-&gt;win)
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; evas_object_del(wid-&gt;win);
+
+&nbsp;&nbsp;&nbsp;free(wid);
+
+&nbsp;&nbsp;&nbsp;return WIDGET_ERROR_NONE;
+}
+
 </pre>
 
 <h2 id="get_instance">Managing the Widget Instance</h2>