Skip to content

Commit

Permalink
[GUICallback] Correct operators &operator=(GUIEvent<Cookie> &aEvent) …
Browse files Browse the repository at this point in the history
…and &operator=(Callback<Result, Cookie> &aCallback).
  • Loading branch information
ace20022 committed Aug 25, 2013
1 parent 57e492e commit 0859f84
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions xbmc/guilib/GUICallback.h
Expand Up @@ -55,16 +55,11 @@ class GUIEvent
// Assign an EventHandler (EventHandler's are derived from Event) // Assign an EventHandler (EventHandler's are derived from Event)
GUIEvent<Cookie> &operator=(GUIEvent<Cookie> &aEvent) GUIEvent<Cookie> &operator=(GUIEvent<Cookie> &aEvent)
{ {
if (&aEvent) if (&aEvent != this)
{ {
m_pInstance = aEvent.m_pInstance; m_pInstance = aEvent.m_pInstance;
m_pMethod = aEvent.m_pMethod; m_pMethod = aEvent.m_pMethod;
} }
else
{
GUIEvent();
}

return *this; return *this;
} }


Expand Down Expand Up @@ -136,16 +131,11 @@ class Callback
// Assign a CallbackHandler (CallbackHandler's are derived from Callback) // Assign a CallbackHandler (CallbackHandler's are derived from Callback)
Callback<Result, Cookie> &operator=(Callback<Result, Cookie> &aCallback) Callback<Result, Cookie> &operator=(Callback<Result, Cookie> &aCallback)
{ {
if (&aCallback) if (&aCallback != this)
{ {
m_pInstance = aCallback.m_pInstance; m_pInstance = aCallback.m_pInstance;
m_pMethod = aCallback.m_pMethod; m_pMethod = aCallback.m_pMethod;
} }
else
{
Callback();
}

return *this; return *this;
} }


Expand Down

0 comments on commit 0859f84

Please sign in to comment.