Dalamud/Dalamud/Utility
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
..
Numerics fix warnings in Dalamud 2023-06-09 23:38:13 +02:00
Signatures chore: make SigScanner public, have separate service TargetSigScanner that resolves via ISigScanner (closes #1426) 2023-09-24 01:49:34 +02:00
Timing chore: warnings pass 2022-10-29 15:19:52 +02:00
Api10ToDoAttribute.cs Normalize namespaces 2024-02-28 17:11:29 +09:00
ArrayExtensions.cs Implement FontChooserDialog (#1637) 2024-02-13 20:09:46 +00:00
AsyncUtils.cs fix warnings in Dalamud 2023-06-09 23:38:13 +02:00
DateTimeSpanExtensions.cs More notification localizations 2024-02-28 17:11:30 +09:00
DisposeSafety.cs Add IInternal/PublicDisposableService (#1696) 2024-03-16 15:58:05 +00:00
EnumExtensions.cs Add DalamudAssetManager 2023-11-28 22:31:46 +01:00
EventHandlerExtensions.cs Add IContextMenu service (#1682) 2024-02-29 15:15:02 -08:00
FuzzyMatcher.cs refactor: move Dalamud.Interface utils into main assembly, warnings pass 2023-08-04 19:36:09 +02:00
Hash.cs chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00
HitchDetector.cs feat: detect hitches in framework update, draw and gamenetwork 2023-02-17 21:02:49 +01:00
IDeferredDisposable.cs Make IDalamudTextureWrap ICloneable 2024-02-25 21:21:50 +09:00
IRefCountable.cs Add IFontHandle.Lock and WaitAsync 2024-01-21 03:10:41 +09:00
MapUtil.cs Add conversion from World Coordinates to Map Coordinates (#882) 2022-06-15 20:40:58 +02:00
RollingList.cs Limit console log lines held in memory (#1683) 2024-02-27 19:15:11 +01:00
ScopedSyncRoot.cs fix: lock profile manager while changing state 2023-06-20 19:20:08 +02:00
SeStringExtensions.cs feat: validate player name 2023-02-26 13:46:05 -05:00
StableInsertionSortExtension.cs refactor: move Dalamud.Interface utils into main assembly, warnings pass 2023-08-04 19:36:09 +02:00
StringExtensions.cs feat: validate player name 2023-02-26 13:46:05 -05:00
TexFileExtensions.cs chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00
ThreadBoundTaskScheduler.cs Use custom TaskScheduler for Framework.RunOnTick (#1597) 2024-03-14 00:36:38 +01:00
ThreadSafety.cs ConsoleWindow racecon fix and highlight 2024-03-09 04:09:29 +09:00
ThrowHelper.cs Limit console log lines held in memory (#1683) 2024-02-27 19:15:11 +01:00
Util.cs Add IInternal/PublicDisposableService (#1696) 2024-03-16 15:58:05 +00:00
VectorExtensions.cs chore: convert Dalamud to file-scoped namespaces 2022-10-29 15:23:22 +02:00