Hi Matt,

> When free'ing gamestate in main.c before game_run() is called, everything
> is fine.
>
> When free'ing the pointer (s, or _s) in the beginning of game_run(), the
> heap/pointer is corrupted.

This is *exactly* what I was getting when I was developing sci_memory.c. As
soon as a pointer passes from the main program to the DLL, it seems to
become invalid. Nothing happens to the memory at that location except that
Windows may class it as unused and write over it!

The way I got around it was by adding sci_memory.c to the sciv project as
well as the fsci_dll project. It's obviously ridiculous for us to have to
add all .c files in fsci_dll to sciv.

As for what to do next, I'm not sure. I thought perhaps that it was
dllexport/dllimport, but the dllexport part (at least) should be handled
quite adequately by freesci.def.

I think I'll post something to an MS newsgroup about this. In the meantime,
good luck!

Alex.



Reply via email to