How do I fix "Pure virtual function being called while application was running (GIsRunning == 1)"?

Have any of you run across this? The game crashes and gives this error. This seems to happen, but only sometimes, when players are browsing through the menu system. I can’t reliably reproduce the crash. Can anyone at least point me in the right direction? Thanks.

Edit: This error seems connected to other UE3 games on Steam. Perhaps a problem with the OnlineSubsystemSteamworks?
Edit 2: This specific error message is in the UE3 C++ code and apparently gets called when dealing with a double fault. I think I’m in over my head.

Is this a windows error, or one that shows in UDK logs?

When you say “browsing the menu system”. What is happening in these menus? Are you making calls to the Steam API, etc?

It’s the error window that pops up when the game crashes. As far as I can tell, it just happens sometimes when players are clicking in Scaleform menus. But I think it may also be the same error that appears when I open a lot of Scaleform movies at the same time. I’m not entirely sure I know what caused it, but I think I’ve fixed it…

I was eventually able to set up a battle that made my game crash. The game would crash and my IDE would want to find d:\depot\unrealengine3-sf4-pure\src\kernel\heappt\heappt_freebin.cpp. I don’t have that file, but I do have this header with a very similar name: Development\External\GFx\Src\Kernel\HeapPT\HeapPT_FreeBin.h.

The error in Visual Studio was

Unhandled exception ... Access violation reading location 0xfffffffffffff.
Call stack location:
    RPGTacGame.exe!Scaleform::HeapPT::FreeBin::PullBest(unsigned __int64 blocks=0x...) Line 553 + 0x6c bytes

C++ really isn’t my strongest skill, but I could figure out at least that there’s a problem with how the game allocates memory when opening a Scaleform movie. Eventually I combined some movies so that one movie will show all of the status effects when they appear, so I don’t have to make a new movie for each status effect. Then I just limited the maximum number of dialog windows that can appear at once.

And in the menu, around the area where players reported problems, I was just super careful with adding event listeners only once, and removing them only once, and I think that fixed the problem inside the menu.

Almost all of the crashing issues I’ve had over the life of my game have been around me calling an Unrealscript resource from Scaleform when that resource no longer exists (has been garbage collected).

For example: I would create a GfxObject, then close/end that object in Unrealscript, but didn’t also cleanup the Scalform reference, then the Scaleform movieclip tries to call a function on the US object which no longer exists. This results in a hard crash everytime.

I’m not sure if that’s what’s happening for you, but just sharing what’s caused Scaleform related crashes for me in the past.