Commit Graph

8 Commits

Author SHA1 Message Date
Peace-Maker
2c8614c639 Keep optional natives optional after reloading
Bug 6518

Starting from no plugins loaded, after the final step of the following,
basetriggers will be marked as errored because mapchooser is missing:

Load basetriggers
Load mapchooser
Unload mapchooser
Load mapchooser
Unload mapchooser

We lose the SP_NTVFLAG_OPTIONAL when removing a WeakNative. The
__pl_mapchooser_SetNTVOptional() is only called in basetriggers when it
is loaded. It adds the OPTIONAL flag to the mapchooser natives the
basetrigger plugin uses.
When mapchooser is loaded, the native is overwritten and the OPTIONAL
flag consumed (WeakNative registered), but not preserved. Later when
mapchooser is unloaded the WeakNative is removed in
CNativeOwner::UnbindWeakRef, but the OPTIONAL flag isn't added again.
The next time mapchooser is loaded, the natives aren't optional anymore
and will cause a real dependency.

The change in ShareSys isn't needed to fix the error, but is included to
keep the SP_NTVFLAG_OPTIONAL flag consistent.
2016-07-21 01:52:47 +02:00
David Anderson
0aaa659e29 Fix how the mark-serial is used.
The mark-serial is a generation number to optimize dependency tracking. It did not actually get
applied correctly, meaning that in rare cases we could miss dependencies. This patch removes the
incorrect serial propagation and ensures that we don't double-count a dependent plugin.

Additionally, this patch ensures that all callers of BindNativeToPlugin() will update the mark
serial, as is required to correctly track dependencies.
2015-09-14 12:50:50 -07:00
David Anderson
fcaa5361c8 Don't expose mutable sp_native_t. 2015-02-24 23:10:18 -08:00
David Anderson
4500964394 Use Refcounted to manage to NativeEntry (bug 5852 part 4, r=ds).
--HG--
extra : rebase_source : 2e08816db6819c9d9957a0e0ade9cd1aa420fd54
2013-08-30 10:16:28 -07:00
David Anderson
3da646f913 Simplify NativeEntry state (bug 5852 part 3, r=ds).
--HG--
extra : rebase_source : e80ed1c3b3af0b48fff6632eb131ca534a2c2885
2013-08-30 10:14:18 -07:00
David Anderson
140436c2cb Store C++ native lists more optimally in ShareSys (bug 5852 part 2, r=ds).
--HG--
extra : rebase_source : 75b786b4c839ec48bf32982486fbbafa1050ad55
2013-08-30 10:12:44 -07:00
David Anderson
0e677fb3a2 Remove native override API (bug 5852 part 1, r=ds).
--HG--
extra : rebase_source : 9df0399c88721b63667a9b0b5dca0eb20168117a
2013-08-30 10:10:57 -07:00
David Anderson
045ee262a8 Move scared guts of core into logic (bug 5680, r=fyren).
--HG--
rename : core/ExtensionSys.cpp => core/logic/ExtensionSys.cpp
rename : core/ExtensionSys.h => core/logic/ExtensionSys.h
rename : core/HandleSys.cpp => core/logic/HandleSys.cpp
rename : core/HandleSys.h => core/logic/HandleSys.h
rename : core/NativeInvoker.cpp => core/logic/NativeInvoker.cpp
rename : core/NativeInvoker.h => core/logic/NativeInvoker.h
rename : core/NativeOwner.cpp => core/logic/NativeOwner.cpp
rename : core/NativeOwner.h => core/logic/NativeOwner.h
rename : core/PluginSys.cpp => core/logic/PluginSys.cpp
rename : core/PluginSys.h => core/logic/PluginSys.h
rename : core/ShareSys.cpp => core/logic/ShareSys.cpp
rename : core/ShareSys.h => core/logic/ShareSys.h
rename : core/smn_fakenatives.cpp => core/logic/smn_fakenatives.cpp
rename : core/logic/AutoHandleRooter.h => public/AutoHandleRooter.h
2013-03-29 11:37:29 -07:00