Hot restart frees the old isolate's NativeCallables while mpv handles stay alive; media_kit then quits them on the next start and mpv calls the dead wakeup callback (SIGSEGV on the mpv 'core' thread). A debug-only runner hook clears every live handle's wakeup callback on the engine's on-pre-engine-restart signal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
538 B
C
14 lines
538 B
C
#ifndef RUNNER_HOT_RESTART_GUARD_H_
|
|
#define RUNNER_HOT_RESTART_GUARD_H_
|
|
|
|
#include <flutter_linux/flutter_linux.h>
|
|
|
|
// Debug builds: before a hot restart tears the Dart isolate down, unhooks
|
|
// the libmpv wakeup callbacks that media_kit's players point at that
|
|
// isolate's NativeCallables. Without this, the next mpv event on a leftover
|
|
// player calls into freed code and the process dies (SIGSEGV on mpv's
|
|
// "core" thread). No-op in profile/release.
|
|
void hot_restart_guard_attach(FlView* view);
|
|
|
|
#endif // RUNNER_HOT_RESTART_GUARD_H_
|