FPakFile public Constructor Inaccessible. Why does VS want to reference the FPakFile private destructor instead?

If FPakFile destructor is private, it means the engine doesn’t want you to create or destroy them directly. When constructing a class/struct like you did, the destructor is implicitly called at the end of the scope, which is why VS is complaining. Using “new” hides the problem because it allocates the object in memory and you are responsible for destroying it yourself to free memory when you don’t need it anymore (or you are supposed to). In this case, you are never destroying it so it’s basically a memory leak.

After glancing through the API and the plugin code, I see the FPakFile is created “properly” by the Mount() function, which is called right after the part you showed. The Mount() function also checks for validity. I don’t see any reason to check for PAK validity before the Mount() function does it.

1 Like