From 7ddd4e6eec92e5d061ef5c4f66799179b7667648 Mon Sep 17 00:00:00 2001 From: sewn Date: Sun, 6 Oct 2024 19:18:02 +0300 Subject: [PATCH] cmd/vinegar: use another log entry for forced studio closure fixes #445 --- cmd/vinegar/binary.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/vinegar/binary.go b/cmd/vinegar/binary.go index 9578078..5fe3924 100644 --- a/cmd/vinegar/binary.go +++ b/cmd/vinegar/binary.go @@ -36,8 +36,10 @@ const ( ) const ( - // Works for both studio and player - ShutdownEntry = "[FLog::Output] Fmod Closed." + // Randomly chosen log entry in cases where Studios process + // continues to run. Due to a lack of bug reports, it is unknown + // specifically which entry to use for these types of cases. + StudioShutdownEntry = "[FLog::LifecycleManager] Exited ApplicationScope" ) const ( @@ -358,13 +360,9 @@ func (b *Binary) Tail(name string) { for line := range t.Lines { fmt.Fprintln(b.Prefix.Stderr, line.Text) - // Occasionally, Roblox may not close its window and hogs up memory - // as a result. - if strings.Contains(line.Text, ShutdownEntry) { + if strings.Contains(line.Text, StudioShutdownEntry) { go func() { - // Studio takes some time to cleanup its resources. time.Sleep(KillWait) - syscall.Kill(syscall.Getpid(), syscall.SIGTERM) }() }