Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call CTO2GameClientShell's destructor correctly. #80

Open
wants to merge 1 commit into
base: linux-x86_64
Choose a base branch
from

Conversation

rohit-n
Copy link
Collaborator

@rohit-n rohit-n commented Oct 15, 2021

On Linux, the destructor is called when the program closes
instead of when libCShell.so is unloaded, resulting in
crashes. Instead, allocate CTO2GameClientShell on the heap when
the library is loaded, then delete it in CClientMgr::TermClientShellDE.

We also need to set a flag in CConsole when this happens, as PrintString
incorrectly thinks i_client_shell is not null and would call OnConsolePrint
from a null pointer when CClientMgr::Term calls ClientStringWhine.

runtime/client/src/clientde_impl.cpp Outdated Show resolved Hide resolved
NOLF2/ClientShellDLL/TO2/GlobalsInit.cpp Outdated Show resolved Hide resolved
On Linux, the destructor is called when the program closes
instead of when libCShell.so is unloaded, resulting in
crashes. Instead, allocate CTO2GameClientShell on the heap when
the library is loaded, then delete it in CClientMgr::TermClientShellDE.

We also need to set a flag in CConsole when this happens, as PrintString
incorrectly thinks i_client_shell is not null and would call OnConsolePrint
from a null pointer when CClientMgr::Term calls ClientStringWhine.
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