x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Assertion failed: IsValidLowLevel() in UObject\Obj.cpp] [Line: 667]

My app sometimes crashed with following stack:

 Assertion failed: IsValidLowLevel() [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Obj.cpp] [Line: 667] 
 
 
 
 UE4Editor_Core!FDebug::AssertFailed() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:440]
 UE4Editor_CoreUObject!UObject::ConditionalBeginDestroy() [d:\build\++ue4+release-4.12+compile\sync\engine\source\runtime\coreuobject\private\uobject\obj.cpp:668]
 UE4Editor_HuaiKX_6834_Win64_DebugGame!GroupEntity::Clear() [d:\workspace\unreal_project\huaikongxin\program\server\huaikxsrv\source\huaikx\logic\private\pvpmodule\groupentity.cpp:142]

and this issue occurs at AllUnits_[i]->ConditionalBeginDestroy(); of my code:

 void GroupEntity::Clear()
 {
     for (int i = 0; i < WARRIOR_COUNT_MAX; i++)
     {
         if (AllUnits_[i])
         {
             AllUnits_[i]->ConditionalBeginDestroy();
             AllUnits_[i] = NULL;
         }
     }
     }
 }

but I can't reproduce this issue, it occurs irregularly. I wonder what situation would make an Actor Invalid and not NULL.

If don't invoke ConditionalBeginDestroy() when IsValidLowLevel() return false, does it cause memory leak?

Product Version: UE 4.12
Tags:
more ▼

asked Jul 31 '16 at 05:37 AM in Bug Reports

avatar image

笑傲江湖-DA
216 11 23 29

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey 笑傲江湖-DA,

My best guess is that the current "AllUnits_[ i ]" element may still be a valid pointer but a invalid UObject, resulting in the Assert on IsValidLowLevel( ).

If AllUnits_ is a TArray, you could change the loop from relying on WARRIOR_COUNT_MAX to something like:

 for (auto& Unit : AllUnits_)
 {
    Unit->ConditionalBeginDestroy( );
    Unit = NULL;
 }

or

 for( int32 = Index = 0; Index < AllUnits_.Num( ); Index++ )
 {
     AllUnits_[Index]->ConditionalBeginDestroy( );
     AllUnits_[Index] = NULL;
 }

more ▼

answered Aug 01 '16 at 02:59 PM

avatar image

ImVawx ♦♦ STAFF
6.7k 114 16 126

avatar image 笑傲江湖-DA Aug 01 '16 at 04:35 PM

Thx so much for your help! I will try it later. Have a nice day!

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question