1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 08:47:17 +01:00

Allow unbinding of command listener callbacks by passing null.

This commit is contained in:
Sandu Liviu Catalin 2016-08-26 16:56:08 +03:00
parent 46fae978d7
commit e37d01cabd

View File

@ -1649,6 +1649,11 @@ public:
{
STHROWF("Detached commands cannot store script resources");
}
// Are we supposed to unbind current callback?
else if (func.IsNull())
{
m_OnExec.ReleaseGently();
}
// Was there a custom environment specified?
else if (env.IsNull())
{
@ -1678,6 +1683,11 @@ public:
{
STHROWF("Detached commands cannot store script resources");
}
// Are we supposed to unbind current callback?
else if (func.IsNull())
{
m_OnAuth.ReleaseGently();
}
// Was there a custom environment specified?
else if (env.IsNull())
{
@ -1707,6 +1717,11 @@ public:
{
STHROWF("Detached listeners cannot store script resources");
}
// Are we supposed to unbind current callback?
else if (func.IsNull())
{
m_OnPost.ReleaseGently();
}
// Was there a custom environment specified?
else if (env.IsNull())
{
@ -1736,6 +1751,11 @@ public:
{
STHROWF("Detached listeners cannot store script resources");
}
// Are we supposed to unbind current callback?
else if (func.IsNull())
{
m_OnFail.ReleaseGently();
}
// Was there a custom environment specified?
else if (env.IsNull())
{