Login Page - Create Account

Support Board


Date/Time: Sun, 11 May 2025 00:38:35 +0000



Post From: CPU Exception when Study is triggered.

[2024-09-09 18:01:08]
User431178 - Posts: 670
Your is_init block is the source of the problem.

You are giving sc.SetPersistentPointer the address of your vector, but the vector object is destroyed when it goes out of scope at the end of the is_init block.
The result of this is a dangling pointer / pointer to nothing being stored, and then subsequently an exception when you try to work with that pointer.

Take a look at the info linked below, there is an example of an init / clean up pattern for classes, this would apply to std::vector.
ACSIL Programming Concepts: Allocating Memory for Classes