Incorrect RemoveObject code in ObjectLibrary.cpp

(This is also present in the current release of the code in Github)

In

bool UObjectLibrary::RemoveObject(UObject *ObjectToRemove)

The code uses the wrong array when bUseWeakReferences. The code uses Objects.Remove when UseWeak is set true. This is in reverse to that used during AddObject.

Hello AdrianPBrown,

Thank you for reporting this issue. I’ve placed a bug report in for this to have it changed around so that it isn’t mixed up anymore. You can find that report here: UE-41151

In the future, if there are changes like this that you believe you could fix, feel free to submit a Pull Request through Github. One of our Devs will review it and decide whether it should be committed into the engine.

Have a nice day!