Skip to content

Fixed referencing of released m_pCallingConvention on Source.Python unload.#387

Merged
jordanbriere merged 1 commit into
Source-Python-Dev-Team:masterfrom
CookStar:fix_unhook
Feb 11, 2021
Merged

Fixed referencing of released m_pCallingConvention on Source.Python unload.#387
jordanbriere merged 1 commit into
Source-Python-Dev-Team:masterfrom
CookStar:fix_unhook

Conversation

@CookStar

@CookStar CookStar commented Feb 11, 2021

Copy link
Copy Markdown
Contributor

UnhookAllFunctions releases all m_pCallingConventions, but CFunctions held by AutoUnload such as EntityPreHook are not yet released, causing segmentation fault.

else if (m_eCallingConvention != CONV_CUSTOM && !dynamic_cast<ICallingConventionWrapper *>(m_pCallingConvention))

UnhookAllFunctions has been moved to the end to deal with this.

@jordanbriere

Copy link
Copy Markdown
Contributor

Thanks, I was able to reproduce (not the crash, but the behaviours which I can see randomly leading to one). This also fixes potential issues if a plugin was dumb enough to register hooks in its unload method.

@jordanbriere jordanbriere merged commit bb0a3e8 into Source-Python-Dev-Team:master Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants