[#7305] fixed deadlock when manually triggering the OnTerminate hook

Co-authored-by: Felix <FelixM@yer.tools>
This commit is contained in:
Gani GeorgievandFelix committed 2025-11-07 17:03:15 +02:00
1 parent 41607679a0
commit fcb5b5dd67
4 files changed
+30 -6

No files matched your search

+2
View File
@@ -205,6 +205,8 @@ func (pb *PocketBase) Execute() error {
<-done
// trigger cleanups
//
// @todo consider skipping and just call the finalizer in case OnTerminate was already invoked manually?
event := new(core.TerminateEvent)
event.App = pb
return pb.OnTerminate().Trigger(event, func(e *core.TerminateEvent) error {