Editor Crashed when leaving Play in Editor

When I initialize the object with ;

FObjectInitializer& PCIP;
fob = &PCIP;
ABaseEffect* subEffect = new ABaseEffect(*fob);

ABaseEffect is a Actor derived class …

MachineId:C72540864DA73BD20E69A3880BC16EDB
EpicAccountId:

Unknown exception - code 00000001 (first/second chance not available)

Assertion failed: !ObjectInitializer.Obj || ObjectInitializer.Obj == this [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 1853]

KERNELBASE + 24684 bytes
UE4Editor_Core + 3140052 bytes
UE4Editor_Core + 1614600 bytes
UE4Editor_Core + 1494994 bytes
UE4Editor_CoreUObject + 1299499 bytes
UE4Editor_Engine + 1037414 bytes
UE4Editor_Engine + 8826523 bytes
UE4Editor_TenekurOffline_2910!APlayerCharacter::WaitForSpellCast() + 148 bytes [c:\users\ahmetfaruk\desktop\tenekuroffline\source\tenekuroffline\character\playercharacter.cpp:1044]
UE4Editor_TenekurOffline_2910!APlayerCharacter::execUseSpell() + 186 bytes [c:\users\ahmetfaruk\desktop\tenekuroffline\source\tenekuroffline\character\playercharacter.h:16]
UE4Editor_CoreUObject + 570740 bytes
UE4Editor_CoreUObject + 1353417 bytes
UE4Editor_CoreUObject + 1620778 bytes
UE4Editor_CoreUObject + 1483596 bytes
UE4Editor_CoreUObject + 1354844 bytes
UE4Editor_CoreUObject + 1627204 bytes
UE4Editor_CoreUObject + 1483596 bytes
UE4Editor_CoreUObject + 570740 bytes
UE4Editor_CoreUObject + 1481403 bytes
UE4Editor_Engine + 1552387 bytes
UE4Editor_Engine + 15148050 bytes
UE4Editor_Engine + 6607726 bytes
UE4Editor_Engine + 6664389 bytes
UE4Editor_Engine + 6600171 bytes
UE4Editor_Engine + 6662990 bytes
UE4Editor_Engine + 1362596 bytes
UE4Editor_Engine + 8918022 bytes
UE4Editor_Engine + 8966477 bytes
UE4Editor_Core + 729178 bytes
UE4Editor_Core + 729645 bytes
UE4Editor_Core + 859557 bytes
UE4Editor_Engine + 9204085 bytes
UE4Editor_Engine + 9111984 bytes
UE4Editor_Engine + 9122362 bytes
UE4Editor_Engine + 5678998 bytes
UE4Editor_Engine + 5705227 bytes
UE4Editor_UnrealEd + 1839740 bytes
UE4Editor_UnrealEd + 6723958 bytes
UE4Editor!FEngineLoop::Tick() + 4084 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2240]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:131]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Hey XAfgun-

I have a couple extra questions before I begin digging into this issue. Does this crash happen when you compile the project in Visual Studio or when compiling from within the editor? Does the same crash occur in a new project or does it only happen in your current project? Also, what is the “fob” that you are referencing? Additional information on where the crash is occurring and what you’re doing at the time will help determine what is causing it to happen.

Cheers

Doug Wilson

APlayerCharacter::APlayerCharacter(const class FObjectInitializer& PCIP)
: Super(PCIP)
{
fob = &PCIP;
}

I got error when I using editor, when I try to get create ABaseSpell class. in this lines

ABaseEffect* subEffect;
subEffect = new ABaseEffect(*fob);

I think, I couldn’t contruct ABaseEffect but why :frowning:

MachineId:C72540864DA73BD20E69A3880BC16EDB
EpicAccountId:

Unknown exception - code 00000001 (first/second chance not available)

Assertion failed: !ObjectInitializer.Obj || ObjectInitializer.Obj == this [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 1853]

KERNELBASE + 24684 bytes
UE4Editor_Core + 3140052 bytes
UE4Editor_Core + 1614600 bytes
UE4Editor_Core + 1494994 bytes
UE4Editor_CoreUObject + 1299499 bytes
UE4Editor_Engine + 975446 bytes

UE4Editor_TenekurOffline!ABaseEffect::ABaseEffect() + 38 bytes [c:\users\ahmetfaruk\desktop\tenekuroffline\source\tenekuroffline\effect\baseeffect.cpp:11]
UE4Editor_TenekurOffline!APlayerCharacter::ApplySpell() + 851 bytes [c:\users\ahmetfaruk\desktop\tenekuroffline\source\tenekuroffline\character\playercharacter.cpp:1342]
UE4Editor_TenekurOffline!APlayerCharacter::execApplySpell() + 114 bytes [c:\users\ahmetfaruk\desktop\tenekuroffline\source\tenekuroffline\character\playercharacter.h:16]

UE4Editor_CoreUObject + 570740 bytes
UE4Editor_CoreUObject + 1353417 bytes
UE4Editor_CoreUObject + 1477821 bytes
UE4Editor_CoreUObject + 1483596 bytes
UE4Editor_CoreUObject + 1354844 bytes
UE4Editor_CoreUObject + 1627204 bytes
UE4Editor_CoreUObject + 1483596 bytes
UE4Editor_CoreUObject + 570740 bytes
UE4Editor_CoreUObject + 1481403 bytes
UE4Editor_AIModule + 1469977 bytes
UE4Editor_AIModule + 386139 bytes
UE4Editor_AIModule + 387871 bytes
UE4Editor_AIModule + 548577 bytes
UE4Editor_AIModule + 624803 bytes
UE4Editor_Engine + 1215411 bytes
UE4Editor_Engine + 1361353 bytes
UE4Editor_Engine + 8918310 bytes
UE4Editor_Engine + 8966765 bytes
UE4Editor_Core + 729370 bytes
UE4Editor_Core + 729837 bytes
UE4Editor_Core + 859509 bytes
UE4Editor_Engine + 9204373 bytes
UE4Editor_Engine + 9112272 bytes
UE4Editor_Engine + 9122650 bytes
UE4Editor_Engine + 5679126 bytes
UE4Editor_Engine + 5705408 bytes
UE4Editor_UnrealEd + 1839948 bytes
UE4Editor_UnrealEd + 6724134 bytes
UE4Editor!FEngineLoop::Tick() + 4084 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2240]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:131]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

const FObjectInitializer* foob = new FObjectInitializer();
ABaseEffect* subEffect = new ABaseEffect(*foob);

I used it and fixed problem but now I have crashed for this problem. Have a nice days…

MachineId:C72540864DA73BD20E69A3880BC16EDB
EpicAccountId:

Unknown exception - code 00000001 (first/second chance not available)

Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.7\Engine\Source\Runtime\CoreUObject\Private\Templates\Casts.cpp] [Line: 11]
Cast of Package //Engine//Transient to Level failed

KERNELBASE + 24684 bytes
UE4Editor_Core + 3140052 bytes
UE4Editor_Core + 1614303 bytes
UE4Editor_CoreUObject + 371383 bytes
UE4Editor_Engine + 865388 bytes
UE4Editor_UnrealEd + 1500718 bytes
UE4Editor_UnrealEd + 4752117 bytes
UE4Editor_UnrealEd + 4381175 bytes
UE4Editor_UnrealEd + 1835269 bytes
UE4Editor_UnrealEd + 6724134 bytes
UE4Editor!FEngineLoop::Tick() + 4084 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:2240]
UE4Editor!GuardedMain() + 479 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:131]
UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

Hey XAfgun-

I’m still not sure what you’re doing at the time the crash occurs. Are you adding something from the content browser to the level? Are you working inside of blueprints or the material editor? Does the crash happen when you click Play In Editor? If you could provide the steps of what you were doing leading up to the crash it will help reproduce the crash on my end for further testing. Also, could you include the logs of the crash from the project’s Saved->Logs folder since there will be extra information there that could help.

When I press stop , editor crashed.

link text

Are you pressing stop from play in editor or from simulate? Or are you referring to stopping a debug of the engine through Visual Studio? Also, are you trying to cast from one object to another? There may be a circular dependency that is causing issues.

Play in Unreal Editor. I casted base class to derived class.

So you’re able to play in editor without any problem but then crash when you exit? Does the crash happen if you play in a standalone window as well? Are you able to reproduce this crash in a new project? If so can you walk me through the steps that lead to the crash so that I can reproduce it on my machine?

Cheers

Doug Wilson

Yes I m able to play in editor without any problem. Crash happen in all.

I think I create new actor but don’t spawn in level. Problem could be this. I don’t know.

Reason of crash is this lines :

/// 
/// Applies the effect.
/// 
void APlayerCharacter::ApplyEffect(ABaseEffect* _eff){
	const FObjectInitializer* foob = new FObjectInitializer();
	ABaseEffect *eff = new ABaseEffect(*foob);
	eff->Init(_eff);
	if (GetPlayerEffectByID(eff->ID) == NULL) {
		AddEffect(eff);
	}
	else {
		if (GetPlayerEffectByID(eff->ID)->level > eff->level){
			DeleteEffect(GetPlayerEffectByID(eff->ID));
			AddEffect(eff);
		}
		else if (GetPlayerEffectByID(eff->ID)->level == eff->level){
			GetPlayerEffectByID(eff->ID)->_curEffectTime = eff->_maxEffectTime;
		}
		else {//GetPlayerEffectByID(eff->ID)->level < eff->level
			DeleteEffect(GetPlayerEffectByID(eff->ID));
			AddEffect(eff);
		}

	}
	UpdateAll();
}

Hey XAfgun-

Is this still the same crash when exiting play in editor? If it is does the crash also occur on a newly created project? Does the crash stop occurring if you remove the code above?

If this is not the same crash as originally reported then could you create a new post specifically for this crash? Doing so will help track the different issues and help us focus resources on finding the exact cause and solution.

Hi XAfgun,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.