~iaz/unity/menubar-lp789979

« back to all changes in this revision

Viewing changes to UnityCore/GLibSignal.cpp

BamfLauncherIcon: Unset the BamfApplication when removing the icon.
  
Doing this manually, we prevent that a duplicated application can be added between the removal of the BamfLauncherIcon and the effective destruction (that is controlled by a timeout in LauncherModel).
. Fixes: https://bugs.launchpad.net/bugs/1003574. Approved by Tim Penhey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
// (it allows you to pass in a GObject without casting up).
72
72
void SignalManager::Disconnect(void* object, std::string const& signal_name)
73
73
{
74
 
  for (ConnectionVector::iterator it = connections_.begin();
75
 
       it != connections_.end();
76
 
       ++it)
 
74
  for (auto it = connections_.begin(); it != connections_.end(); ++it)
77
75
  {
78
 
    if ((*it)->object() == object
79
 
        && (*it)->name() == signal_name)
 
76
    if ((*it)->object() == object &&
 
77
        (signal_name.empty() || (*it)->name() == signal_name))
80
78
    {
81
79
      (*it)->Disconnect();
82
80
      connections_.erase(it, it);