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

initialize AZ::SerializeContext to nullptr #18546

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

kh-huawei
Copy link
Contributor

What does this PR do?

Initialize the Serialize-context to nullptr, so the user gets an assert instead of a crash caused by accessing an uninitialized pointer.

@kh-huawei kh-huawei requested review from a team as code owners December 10, 2024 11:05
@byrcolin byrcolin added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Dec 10, 2024
@spham-amzn
Copy link
Contributor

Searching through the code, I found 24 matches of the uninitialized context as well. Can you include those in thie PR as well?
(Search for AZ::SerializeContext* context;)

@kh-huawei kh-huawei force-pushed the init_context_to_null branch from f566909 to 0538042 Compare December 17, 2024 10:41
@kh-huawei kh-huawei requested review from a team as code owners December 17, 2024 10:41
@kh-huawei
Copy link
Contributor Author

Searching through the code, I found 24 matches of the uninitialized context as well. Can you include those in the PR as well? (Search for AZ::SerializeContext* context;)

I've gone over all calls to Events::GetSerializeContext and tried to make sure the variable used there was initialized. There were a few that had different names for the variable...

@lsemp3d lsemp3d merged commit fde694e into o3de:development Dec 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants