upload tizen1.0 source
[profile/ivi/obexd.git] / gobex / gobex.c
index aa86f9e..4afc21b 100644 (file)
@@ -1316,7 +1316,11 @@ GObex *g_obex_ref(GObex *obex)
 
 void g_obex_unref(GObex *obex)
 {
+#ifdef TIZEN_PATCH
+       gboolean last_ref, ret;
+#else
        gboolean last_ref;
+#endif
 
        last_ref = g_atomic_int_dec_and_test(&obex->ref_count);
 
@@ -1327,6 +1331,14 @@ void g_obex_unref(GObex *obex)
 
        g_slist_free_full(obex->req_handlers, g_free);
 
+#ifdef TIZEN_PATCH
+       do {
+               ret = write_data(obex->io, G_IO_OUT, obex);
+               if (obex->pending_req && obex->pending_req->cancelled)
+                       break;
+       } while(ret);
+#endif
+
        g_queue_foreach(obex->tx_queue, (GFunc) pending_pkt_free, NULL);
        g_queue_free(obex->tx_queue);