yas-online / UE4-DedicatedServer

A UE4 plugin which adds proper console support (input) and RCon
48 stars 21 forks source link

Thread safe problem #2

Open molixiaoge opened 7 years ago

molixiaoge commented 7 years ago

I use your plugin,and i find that you call GEngine->Exec( GEngine->GetWorld(), *m_sInput ) in your thread!but GEngine->GetWorld()almost run in winmain thread!

neico commented 7 years ago

Is it an actual issue that it's called in a separate thread? (Like actual memory leaks, crashes etc.)

I'm pretty sure that GetWorld() will return NULL (nullptr) in all cases where I call it, so I could just replace that call with that if it's of a concern, I'll need to run some checks on this entire case to make sure.

But my computer currently is hardly even able to handle VS + UE4 so I'll have to wait until I can get more RAM installed before doing so...

PS: I recently delved deeper into multi-threading and the like so I'll likely to change some parts of the code soon anyway just to prevent those topics all together...

molixiaoge commented 7 years ago

GetWorld() always return NULL in your thread,so it can not call my exec function correctly!

neico commented 7 years ago

Then replace GEngine->GetWorld() with GWorld for now (still looking for a better solution)

neico commented 5 years ago

@molixiaoge is it possible that https://github.com/yas-online/UE4-DedicatedServer/commit/9eca9af70c816be6453267ef83f8986845f9bb32 fixed this?