Commit graph

19 commits

Author SHA1 Message Date
Soreepeong
7f5ef03917 Use EarlyLoadedService for anything that is not mandatory for kicking off plugin loader 2024-04-07 21:53:23 +09:00
srkizer
87b9edb448
Add IInternal/PublicDisposableService (#1696)
* Add IInternal/PublicDisposableService

Plugins are exposed interfaces that are not inherited from
`IDisposable`, but services implementing plugin interfaces often
implement `IDisposable`. Some plugins may try to call
`IDisposable.Dispose` on everything provided, and it also is possible to
use `using` clause too eagerly while working on Dalamud itself, such as
writing `using var smth = await Service<SomeService>.GetAsync();`. Such
behaviors often lead to a difficult-to-debug errors, and making those
services either not an `IDisposable` or making `IDisposable.Dispose` do
nothing if the object has been loaded would prevent such errors. As
`ServiceManager` must be the only class dealing with construction and
disposal of services, `IInternalDisposableService` has been added to
limit who can dispose the object. `IPublicDisposableService` also has
been added to classes that can be constructed and accessed directly by
plugins; for those, `Dispose` will be ignored if the instance is a
service instance, and only `DisposeService` will respond.

In addition, `DalamudPluginInterface` and `UiBuilder` also have been
changed so that their `IDisposable.Dispose` no longer respond, and
instead, internal functions have been added to only allow disposal from
Dalamud.

* Cleanup

* Postmerge fixes

* More explanation on RunOnFrameworkThread(ClearHooks)

* Mark ReliableFileStorage public ctor obsolete

---------

Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
2024-03-16 15:58:05 +00:00
srkizer
a0f4baf8fa
Less footguns in service dependency handling (#1560) 2023-12-06 21:29:46 -08:00
goat
ebabb7bd04
chore: make SigScanner public, have separate service TargetSigScanner that resolves via ISigScanner (closes #1426) 2023-09-24 01:49:34 +02:00
MidoriKami
c305c01dfd Nullify Scoped Service Delegates 2023-09-19 23:43:45 -07:00
goat
428e1afefd
fix warnings 2023-09-17 20:11:34 +02:00
Kaz Wolfe
a9a0980372
Fix random build warnings. 2023-09-16 18:07:19 -07:00
MidoriKami
d378fe1dfc
Add IPartyFinderGui (v9) (#1279) 2023-09-10 15:20:44 -07:00
goat
987ff8dc8f
chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00
goat
b093323acc
chore: warnings pass 2022-10-29 15:19:52 +02:00
kizer
716736f022
Improvements (#903) 2022-06-29 11:51:40 +02:00
kizer
3369f569fb
Add call-on-services-ready attribute for service methods, and fix scene nullability (#900) 2022-06-26 18:49:34 +02:00
kizer
8e7f370ddd
Load services asynchronously whenever possible (#893) 2022-06-24 22:12:51 +02:00
goaaats
2d90598b70
refactor: make all PluginInterface classes explicitly disposable 2022-01-08 03:00:56 +01:00
goat
1561fbac00
Revert "refactor(Dalamud): switch to file-scoped namespaces"
This reverts commit b5f34c3199.
2021-11-18 15:23:40 +01:00
goat
b5f34c3199
refactor(Dalamud): switch to file-scoped namespaces 2021-11-17 19:42:32 +01:00
Raymond
29f4797b4c Print warning if dispose fails 2021-08-27 22:31:18 -04:00
Raymond
ff1d7f2829 Implement service locator 2021-08-21 14:03:06 -04:00
Raymond
bab8eb4182 PartyFinder namespaces, break out 2021-08-10 08:04:13 -04:00
Renamed from Dalamud/Game/Internal/Gui/PartyFinderGui.cs (Browse further)