diff --git a/atom/browser/ui/views/global_menu_bar_x11.cc b/atom/browser/ui/views/global_menu_bar_x11.cc index 05e4c51aa8..5ebd79bdb2 100644 --- a/atom/browser/ui/views/global_menu_bar_x11.cc +++ b/atom/browser/ui/views/global_menu_bar_x11.cc @@ -162,8 +162,7 @@ void SetMenuItemID(DbusmenuMenuitem* item, int id) { GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window) : window_(window), xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()), - server_(NULL), - root_item_(NULL) { + server_(NULL) { EnsureMethodsLoaded(); if (server_new) InitServer(xid_); @@ -187,13 +186,13 @@ void GlobalMenuBarX11::SetMenu(ui::MenuModel* menu_model) { if (!server_) return; - root_item_ = menuitem_new(); - menuitem_property_set(root_item_, kPropertyLabel, "Root"); - menuitem_property_set_bool(root_item_, kPropertyVisible, true); - BuildMenuFromModel(menu_model, root_item_); + DbusmenuMenuitem* root_item = menuitem_new(); + menuitem_property_set(root_item, kPropertyLabel, "Root"); + menuitem_property_set_bool(root_item, kPropertyVisible, true); + BuildMenuFromModel(menu_model, root_item); - server_set_root(server_, root_item_); - g_object_unref(root_item_); + server_set_root(server_, root_item); + g_object_unref(root_item); } void GlobalMenuBarX11::InitServer(unsigned long xid) { diff --git a/atom/browser/ui/views/global_menu_bar_x11.h b/atom/browser/ui/views/global_menu_bar_x11.h index b2674ba0ba..2416e02d78 100644 --- a/atom/browser/ui/views/global_menu_bar_x11.h +++ b/atom/browser/ui/views/global_menu_bar_x11.h @@ -63,7 +63,6 @@ class GlobalMenuBarX11 { int xid_; DbusmenuServer* server_; - DbusmenuMenuitem* root_item_; DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11); };