Merge pull request #529 from peace-maker/optional_natives
Keep optional natives optional after reloading
This commit is contained in:
commit
61e958e679
@ -73,7 +73,7 @@ void CNativeOwner::UnbindWeakRef(const WeakNative &ref)
|
|||||||
pContext->GetRuntime()->UpdateNativeBinding(
|
pContext->GetRuntime()->UpdateNativeBinding(
|
||||||
ref.idx,
|
ref.idx,
|
||||||
nullptr,
|
nullptr,
|
||||||
0,
|
SP_NTVFLAG_OPTIONAL,
|
||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,6 +341,8 @@ void ShareSystem::BindNativeToPlugin(CPlugin *pPlugin, const sp_native_t *native
|
|||||||
/* The native is optional, this is a special case */
|
/* The native is optional, this is a special case */
|
||||||
if ((native->flags & SP_NTVFLAG_OPTIONAL) == SP_NTVFLAG_OPTIONAL)
|
if ((native->flags & SP_NTVFLAG_OPTIONAL) == SP_NTVFLAG_OPTIONAL)
|
||||||
{
|
{
|
||||||
|
flags |= SP_NTVFLAG_OPTIONAL;
|
||||||
|
|
||||||
/* Only add if there is a valid owner. */
|
/* Only add if there is a valid owner. */
|
||||||
if (!pEntry->owner)
|
if (!pEntry->owner)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user