widget_app_context_set_tag(context, wid);
return WIDGET_ERROR_NONE;
-}
+}
+
+int widget_instance_destroy(widget_context_h context, widget_app_destroy_type_e reason, bundle *content, void *user_data)
+{
+
+ if (reason != WIDGET_APP_DESTROY_TYPE_PERMANENT)
+ {
+ // Save the current status at the bundle object
+ }
+
+ widget_instance_data_s *wid = NULL;
+ widget_app_context_get_tag(context, (void**)&wid);
+
+ if (wid->win)
+ evas_object_del(wid->win);
+
+ free(wid);
+
+ return WIDGET_ERROR_NONE;
+}
+
</pre>
<h2 id="get_instance">Managing the Widget Instance</h2>