I think here you need to do the weak_ref before inserting into the hash table.
70 + g_hash_table_insert (uon->observed, g_strdup (path), file); 71 + g_object_weak_ref (G_OBJECT(file), 72 + (GWeakNotify)ubuntuone_nautilus_observed_file_unref, 73 + uon);
And I think here, you need to specify g_object_weak_unref as the destroy callback for the data.
+ uon->observed = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
I may be totally wrong on the second one (as weak refs are a little vague), but the first change definitely improves the readability of the code (makes more sense to ref before doing more stuff). Thanks for looking into this.
« Back to merge proposal
I think here you need to do the weak_ref before inserting into the hash table.
70 + g_hash_table_insert (uon->observed, g_strdup (path), file); ubuntuone_ nautilus_ observed_ file_unref,
71 + g_object_weak_ref (G_OBJECT(file),
72 + (GWeakNotify)
73 + uon);
And I think here, you need to specify g_object_weak_unref as the destroy callback for the data.
+ uon->observed = g_hash_ table_new_ full (g_str_hash, g_str_equal, g_free, NULL);
I may be totally wrong on the second one (as weak refs are a little vague), but the first change definitely improves the readability of the code (makes more sense to ref before doing more stuff). Thanks for looking into this.