Gren Meera wrote:
--
[ Picked text/plain from multipart/alternative ]
Hey everybody, I could REALLY use a hand with this!

I needed to make a multi-threaded plugin to handle Port IO for external
hardware.  The problem is, the MOD always crashes when unloading DLLs when
my plugin is loaded.

It dies in random destructors from many different DLLs, but usually it's the
destructor of some global CUtlVector, such as the destructor of
CCollisionEvent g_Collisions.

Is your plugin only doing game engine API access through the main
thread? (i.e. you shouldn't be calling any engine functions from
anything except for your main plugin DLL thread since the engine isn't
thread safe).

Changing your DLL to be thread safe (i.e. setting "Multi-threaded Debug
DLL") won't make the engine be thread safe.

You will probably need so mechanism of signaling between your Port IO
threads and your main thread and funnel all engine API access through
your main thread (i.e. the only thing the threads should do it I/O and
then send that stuff to your main thread who would in turn call engine
functions).

--
Jeffrey "botman" Broome

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to