Skip to content

Commit

Permalink
fix segfault when thread is finalised without golang's runtime gc as …
Browse files Browse the repository at this point in the history
…kicked in

Signed-off-by: Jorge Niedbalski <[email protected]>
  • Loading branch information
niedbalski committed May 12, 2022
1 parent 439e9ac commit dd87125
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cshared.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ func FLBPluginFlush(data unsafe.Pointer, clength C.int, ctag *C.char) int {
func FLBPluginExit() int {
log.Printf("calling FLBPluginExit(): name=%q\n", theName)

if unregister != nil {
unregister()
}

if runCancel != nil {
runCancel()
}

// if unregister != nil {
// unregister()
// }

// if theChannel != nil {
// defer close(theChannel)
// }
if theChannel != nil {
defer close(theChannel)
}

return input.FLB_OK
}
Expand Down

0 comments on commit dd87125

Please sign in to comment.