Skip to content

Commit

Permalink
fixing shared cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed May 15, 2024
1 parent 47ca8fe commit b820fb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/multi.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (e *ThreadSafeNucleiEngine) ExecuteNucleiWithOptsCtx(ctx context.Context, t
return err
}
}
defer tmpEngine.Close()
defer tmpEngine.closeInternal()
// create ephemeral nuclei objects/instances/types using base nuclei engine
unsafeOpts, err := createEphemeralObjects(e.eng, tmpEngine.opts)
if err != nil {
Expand Down
9 changes: 6 additions & 3 deletions lib/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ func (e *NucleiEngine) SignTemplate(tmplSigner *signer.TemplateSigner, data []by
return buff.Bytes(), err
}

// Close all resources used by nuclei engine
func (e *NucleiEngine) Close() {
func (e *NucleiEngine) closeInternal() {
if e.interactshClient != nil {
e.interactshClient.Close()
}
Expand Down Expand Up @@ -215,7 +214,11 @@ func (e *NucleiEngine) Close() {
if e.httpxClient != nil {
_ = e.httpxClient.Close()
}
// close global shared resources
}

// Close all resources used by nuclei engine
func (e *NucleiEngine) Close() {
e.closeInternal()
protocolinit.Close()
}

Expand Down

0 comments on commit b820fb9

Please sign in to comment.