DBusMenu: prevent crashing when the client is destroyed with an open menu
Yes, this can happen; The test tool gained a way to provoke it.
Jonas Kümmerlin
8 years ago
395 | 395 |
},
|
396 | 396 |
|
397 | 397 |
send_event: function(id, event, params, timestamp) {
|
|
398 |
if (!this._proxy)
|
|
399 |
return
|
|
400 |
|
398 | 401 |
this._proxy.EventRemote(id, event, params, timestamp, function(result, error) { /* we don't care */ })
|
399 | 402 |
},
|
400 | 403 |
|
|
580 | 583 |
this._dbusItem.handle_event("opened", null, 0)
|
581 | 584 |
this._dbusItem.send_about_to_show()
|
582 | 585 |
} else {
|
|
586 |
if (NEED_NESTED_SUBMENU_FIX) {
|
|
587 |
// close our own submenus
|
|
588 |
if (menu._openedSubMenu)
|
|
589 |
menu._openedSubMenu.close(false)
|
|
590 |
}
|
|
591 |
|
583 | 592 |
this._dbusItem.handle_event("closed", null, 0)
|
584 | 593 |
}
|
585 | 594 |
},
|
120 | 120 |
});
|
121 | 121 |
menu.append(item);
|
122 | 122 |
|
|
123 |
item = Gtk.MenuItem.new_with_label("Close in 5 seconds");
|
|
124 |
item.connect('activate', function() {
|
|
125 |
GLib.timeout_add(0, 5000, function() {
|
|
126 |
app.quit();
|
|
127 |
return false;
|
|
128 |
});
|
|
129 |
});
|
|
130 |
menu.append(item);
|
|
131 |
|
123 | 132 |
menu.show_all();
|
124 | 133 |
|
125 | 134 |
var indicator = AppIndicator.Indicator.new("Hello", "indicator-test", AppIndicator.IndicatorCategory.APPLICATION_STATUS);
|