summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lord <chris@openedhand.com>2006-06-16 15:23:27 +0000
committerChris Lord <chris@openedhand.com>2006-06-16 15:23:27 +0000
commit0d64078d65a9c51d8e64715b92ce6569a06d2980 (patch)
tree2bceafbbd056e17ae6ff781b0e9de958e6c37c3f
parentb800c1456a28d5b6da6cad1f43bf82be4af9f0de (diff)
downloadsync-0d64078d65a9c51d8e64715b92ce6569a06d2980.tar.gz
sync-0d64078d65a9c51d8e64715b92ce6569a06d2980.tar.bz2
sync-0d64078d65a9c51d8e64715b92ce6569a06d2980.zip
Finalize/free engine in an idle function, rather than in the callback
-rw-r--r--sync/ChangeLog6
-rw-r--r--sync/src/pokysync_main.c16
2 files changed, 19 insertions, 3 deletions
diff --git a/sync/ChangeLog b/sync/ChangeLog
index 5298e7e..2359e30 100644
--- a/sync/ChangeLog
+++ b/sync/ChangeLog
@@ -1,5 +1,11 @@
2006-06-16 Chris Lord,,, <chris@openedhand.com>
+ * src/pokysync_main.c: (pokysync_mappingstatus_cb),
+ (pokysync_enginestatus_cb):
+ Finalize/free engine in an idle function, rather than in the callback
+
+2006-06-16 Chris Lord,,, <chris@openedhand.com>
+
* COPYING:
* INSTALL:
* Makefile.am:
diff --git a/sync/src/pokysync_main.c b/sync/src/pokysync_main.c
index 7a78511..880bf5c 100644
--- a/sync/src/pokysync_main.c
+++ b/sync/src/pokysync_main.c
@@ -208,6 +208,16 @@ pokysync_mappingstatus_cb (OSyncMappingUpdate *status, void *user_data)
}
}
+static gboolean
+pokysync_sync_finish_cb (gpointer data)
+{
+ OSyncEngine *engine = (OSyncEngine *)data;
+
+ g_debug ("Finalizing/freeing sync engine");
+ osengine_finalize (engine);
+ osengine_free (engine);
+}
+
static void
pokysync_enginestatus_cb (OSyncEngine *engine, OSyncEngineUpdate *status,
void *user_data)
@@ -258,9 +268,9 @@ pokysync_enginestatus_cb (OSyncEngine *engine, OSyncEngineUpdate *status,
break;
}
- g_debug ("Cleaning up engine.");
- osengine_finalize (engine);
- osengine_free (engine);
+ data->syncing = FALSE;
+ g_debug ("Setting idle function to clean up engine.");
+ g_idle_add (pokysync_sync_finish_cb, engine);
}
static void