mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 14:33:24 +09:00
[Fix] (Pipe): nothing is published once the split session is gone
MobileGL::Destroy shuts the split roles down first and resets the GL context after, by design. The
frontend objects that die in that reset still found their handles published, so their deletes were
routed to whichever applier was installed by then - the monolith one, which never had those
resources and asserted ("ResourceDestroy named {slot, gen}") from eglTerminate. The abort also
threw away the program's buffered output, so eglinfo printed nothing but the assertion.
Every twin the server held died with the session, so ShutdownSplitRoles now clears the publication
latch (MGPipeForgetAllPublications): the deletes that follow are local bookkeeping only.
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_Pipe/PipeMutation.h> // MGPipeForgetAllPublications, at the end of ShutdownSplitRoles
|
||||
#include <MG_Remote/Client/ClientSession.h>
|
||||
#include <MG_Remote/FatalFunnel.h> // InstallPipeSessionFailHook, installed at step 0 below
|
||||
#include <MG_Remote/Server/ServerLoop.h>
|
||||
@@ -398,6 +399,9 @@ namespace MobileGL::MG_Backend {
|
||||
// and every later split bring-up in the process fails at CreateBackend's m_backend!=null
|
||||
// guard.
|
||||
MG_Remote::Server::ServerLoopInstance().Stop();
|
||||
// The server's twins died with the session; the frontend objects that are destroyed after
|
||||
// this (the GL context's) have nothing left on the other side to delete.
|
||||
MG_Pipe::MGPipeForgetAllPublications();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1828,6 +1828,11 @@ namespace MobileGL::MG_Pipe {
|
||||
*entry = Entry{};
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
for (auto& table : m_kinds) table.clear();
|
||||
m_band.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
struct Entry {
|
||||
Uint32 Gen = 0;
|
||||
@@ -1892,6 +1897,8 @@ namespace MobileGL::MG_Pipe {
|
||||
PublicationLatch().NoteUnpublished(kind, handle);
|
||||
}
|
||||
|
||||
void MGPipeForgetAllPublications() { PublicationLatch().Clear(); }
|
||||
|
||||
// THE GATE ITSELF, AS AN OBSERVABLE (ID-39, widened by S-3 / ID-41). Every P4a birth hook
|
||||
// below and every `wants()` row in the walk resolve through FamilyIsLive /
|
||||
// P4aFamilyHasItsConsumer / P4aFamilyDependenciesAreSet, and none of the three is reachable
|
||||
|
||||
@@ -341,6 +341,12 @@ namespace MobileGL::MG_Pipe {
|
||||
void MGPipeNoteHandlePublished(MGPipeKind kind, MGPipeHandle handle);
|
||||
Bool MGPipeHandleIsPublished(MGPipeKind kind, MGPipeHandle handle);
|
||||
void MGPipeNoteHandleUnpublished(MGPipeKind kind, MGPipeHandle handle);
|
||||
// THE SESSION IS GONE, AND EVERYTHING IT HELD WITH IT. Called once the split roles are shut
|
||||
// down: every object the server twinned died with the session, so nothing is published any
|
||||
// more - and the frontend objects that die after it (MobileGL::Destroy resets the GL context
|
||||
// after ShutdownSplitRoles, by design) must not route a delete for a twin that no longer
|
||||
// exists to whichever applier is installed now, which asserts on the unknown handle.
|
||||
void MGPipeForgetAllPublications();
|
||||
|
||||
// ---- the four mints (pure allocator work, no family knowledge) ----
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user