diff options
author | Brendan Long <self@brendanlong.com> | 2019-01-28 22:23:17 +0300 |
---|---|---|
committer | Brendan Long <self@brendanlong.com> | 2019-01-29 02:35:13 +0300 |
commit | 3fa9452aea70af4b843636f7893d941ff5579940 (patch) | |
tree | 0c9e65e749a0d14721db736d18a5e6fa9299a98c /plugins | |
parent | f4ce70932c4ddc91783309708402c7c42d627455 (diff) |
Remove unsafe threading
- Fix grabber to do DB inserts in the main thread
- Remove unsafe threading throughout the UI
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/backend/decsync/decsyncInterface.vala | 2 | ||||
-rw-r--r-- | plugins/backend/local/localInterface.vala | 24 | ||||
-rw-r--r-- | plugins/share/Twitter/TwitterForm.vala | 2 |
3 files changed, 11 insertions, 17 deletions
diff --git a/plugins/backend/decsync/decsyncInterface.vala b/plugins/backend/decsync/decsyncInterface.vala index 9c2127cc..b99a9140 100644 --- a/plugins/backend/decsync/decsyncInterface.vala +++ b/plugins/backend/decsync/decsyncInterface.vala @@ -185,7 +185,7 @@ public async void postLoginAction() loginButton.get_style_context().remove_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION); loginStack.set_visible_child_name("waiting"); SourceFunc callback = postLoginAction.callback; - new GLib.Thread<void*>(null, () => { + new Thread<void*>(null, () => { m_sync.initStoredEntries(); m_sync.executeStoredEntries({"feeds", "subscriptions"}, new Unit()); Idle.add((owned) callback); diff --git a/plugins/backend/local/localInterface.vala b/plugins/backend/local/localInterface.vala index c6793b57..de83c66e 100644 --- a/plugins/backend/local/localInterface.vala +++ b/plugins/backend/local/localInterface.vala @@ -162,21 +162,15 @@ public void writeData() public async void postLoginAction() { - SourceFunc callback = postLoginAction.callback; - new GLib.Thread<void*>(null, () => { - var children = m_feedlist.get_children(); - foreach(var r in children) - { - var row = r as SuggestedFeedRow; - if(row.checked()) - { - FeedReaderBackend.get_default().addFeed(row.getURL(), row.getCategory(), false, false); - } - } - Idle.add((owned) callback); - return null; - }); - yield; + var children = m_feedlist.get_children(); + foreach(var r in children) + { + var row = r as SuggestedFeedRow; + if(row.checked()) + { + FeedReaderBackend.get_default().addFeed(row.getURL(), row.getCategory(), false); + } + } } public string buildLoginURL() diff --git a/plugins/share/Twitter/TwitterForm.vala b/plugins/share/Twitter/TwitterForm.vala index cdaba89a..e518175b 100644 --- a/plugins/share/Twitter/TwitterForm.vala +++ b/plugins/share/Twitter/TwitterForm.vala @@ -105,7 +105,7 @@ public async void setAPI(TwitterAPI api) { SourceFunc callback = setAPI.callback; - new GLib.Thread<void*>(null, () => { + new Thread<void*>(null, () => { m_urlLength = api.getUrlLength(); Idle.add((owned) callback, GLib.Priority.HIGH_IDLE); return null; |