[gnote] Fix crash when synchronizing when having new notes



commit 47100802d5c157b8352c618d2823cf2443a6f619
Author: Aurimas Äernius <aurisc4 gmail com>
Date:   Thu Feb 16 15:26:42 2012 +0200

    Fix crash when synchronizing when having new notes
    
    Saving note causes UI update, when doing it from a thread, GDK lock required.

 src/synchronization/syncmanager.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/synchronization/syncmanager.cpp b/src/synchronization/syncmanager.cpp
index f1067d3..25f7040 100644
--- a/src/synchronization/syncmanager.cpp
+++ b/src/synchronization/syncmanager.cpp
@@ -384,7 +384,9 @@ namespace sync {
           // This is a new note that has never been synchronized to the server
           // TODO: *OR* this is a note that we lost revision info for!!!
           // TODO: Do the above NOW!!! (don't commit this dummy)
+          gdk_threads_enter();
           (*iter)->save();
+          gdk_threads_leave();
           newOrModifiedNotes.push_back(*iter);
           if(m_sync_ui != 0)
             m_sync_ui->note_synchronized_th((*iter)->get_title(), UPLOAD_NEW);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]