Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Unified Diff: src/main.cc

Issue 5333003: cashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git@master
Patch Set: Address more djkurtz review comments Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cashew_server.cc ('k') | src/service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/main.cc
diff --git a/src/main.cc b/src/main.cc
index 9d233975e5338c1719897d76e82b9b428fb7f1f5..d7f64fe5f37b99e91d7eb2ef9e4566f01833e521 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -47,6 +47,8 @@ static ServiceManager *service_manager = NULL;
static void OnSignal(int signal) {
DLOG(INFO) << "received signal " << signal;
if (main_loop != NULL) {
+ // TODO(vlaviano): g_idle_add a callback to quit the main loop instead of
+ // doing it directly here to remove some low severity races
Daniel Kurtz 2010/11/24 05:05:48 Is this still true?
g_main_loop_quit(main_loop);
}
}
@@ -78,6 +80,7 @@ int InstallSignalHandlers() {
// should not be called while event loop is running
static void CleanUpForExit() {
+ DCHECK(main_loop == NULL || !g_main_loop_is_running(main_loop));
DLOG(INFO) << "cleaning up";
delete server;
server = NULL;
@@ -125,7 +128,7 @@ int main(int argc, char *argv[]) {
DBus::Connection client_conn = DBus::Connection::SystemBus();
client_conn.set_timeout(cashew::kDBusConnectionTimeoutMilliseconds);
cashew::service_manager = new(std::nothrow) cashew::ServiceManager(
- client_conn);
+ client_conn, cashew::main_loop);
if (cashew::service_manager == NULL) {
LOG(ERROR) << "couldn't create service manager";
cashew::CleanUpForExit();
@@ -138,7 +141,7 @@ int main(int argc, char *argv[]) {
server_conn.request_name(cashew::CashewServer::kServiceName);
server_conn.set_timeout(cashew::kDBusConnectionTimeoutMilliseconds);
cashew::server = new(std::nothrow) cashew::CashewServer(server_conn,
- cashew::service_manager);
+ cashew::service_manager, cashew::main_loop);
if (cashew::server == NULL) {
LOG(ERROR) << "couldn't create cashew server";
cashew::CleanUpForExit();
« no previous file with comments | « src/cashew_server.cc ('k') | src/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698