yeah, it's possible that it is the C# thing. i'm new to com/.net interop... but, it's just so weird, because the crash really doesn't seem to have anything to do with that. it all works 100% *perfectly* unless i read a file from within a thread. then it crashes. strange, strange.
to answer your questions:
--is there a crash when reading the file?
--crash when calling configure()?
no, not really. it'll crash if i click the configure button, but configure() (my code) never gets called. if i *don't* click configure, the crash waits until i close winamp.
-- is it maybe thread cleanup?
i'm not sure about that. i'm using pretty standard C# threads, and the data that i read from the text file was read and discarded immediately - nothing else touched it. i forced garbage collection after the thread was finished, as well.
-- does the thread exit before configure is called?
yeah, long before.
-- are you passing a valid pointer to the config function?
yeah, because if i don't load the data in a separate thread, there is no crash. configure() and quit() get called correctly.
-- do the pointers become invalid when i create threads?
no, because if i don't access a file inside of that thread, everything works fine. that is, if i just create a thread and let it spin for awhile, and then close winamp, i get no crash. it's only when there's file access within that thread that i get the crash. but yeah, it is suspicious that the crash is happening at right about the time that winamp should be calling configure() or quit(). and that it's a bad memory access...
i'm going to regret having used C#, i can tell. it's probably doing something behind my back that i didn't ask it to do...