crosswalk-project/crosswalk — pull request #1519 by cmarcelo (2014-01-21 21:02:24+00:00)
Title: [Application][D-Bus] Unlisten for D-Bus name with the correct callback

When running xwalk --run-as-service in Debug mode, Crosswalk was
crashing during shutdown. Reason was that we were creating a new
base::Callback() via bind to unlisten, but we need to use the
same instance.

This commit stores the callback instance so we can unlisten the
correct callback. Because the callback can be cleared, we can use
it instead of keeping a separated boolean.

TEST=Run out/Debug/xwalk --run-as-service and xwalkctl then
close the window. The first process should not crash but exit cleanly.