ok, found the problem..
it was still the old "load something and then discard something else" bug again. It was staring me right in the face.. but I went ahead and used debug, printf statements 'n everything. Actually, after going through the nagi printf statements slowly, I found out where the bug was.
here's the code (there's similar code you had for the save game wrapper as well):
load.view(FORM_NULL);
set.view(ego, FORM_NULL);
if (bDiscardOldViewOnMorph &&
nCurrentEgoView != nEgoViewOnRoomEntry
{
discard.view.v(nCurrentEgoView);
} so basically, you're loading the null view so you can discard the other view.. which means you're technically discarding the null view resource too. (because it's next on the list.. after the current view resource that's about to be discarded).
so what I did:
1) in the new.room section of logic.0, I load the null view resource there. that way it's always available if you want to discard another view object
2) remove loading the null view resource in logic.0 for saving and in logic.90 for morphing.. It still sets the ego to null view though.. just doesn't load it again.
and it works. I've quickly tested it, saving and restoring and there's no problems.
you might want to test a bit more to see if memory or script runs out but I think it's working fine. I did a quick test with "show mem" and the max script level didn't rise.
So I hope that ends the chapter of AGI Memory Management Problem.

- Nick