Some fixes for saving/loading (still broken)

svn-id: r41102
This commit is contained in:
Filippos Karapetis 2009-06-01 15:34:33 +00:00
parent 99c6874630
commit c85134bd5e
2 changed files with 4 additions and 1 deletions

View File

@ -424,7 +424,9 @@ void script_free_engine(EngineState *s) {
s->_kfuncTable.clear();
delete s->_vocabulary;
s->_vocabulary = 0;
delete s->_kernel;
s->_kernel = 0;
}
void script_free_breakpoints(EngineState *s) {

View File

@ -780,6 +780,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
retval->animation_delay = s->animation_delay;
retval->animation_granularity = s->animation_granularity;
retval->gfx_state = s->gfx_state;
retval->old_screen = 0;
retval->resmgr = s->resmgr;
@ -832,8 +833,8 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
retval->parser_base = make_reg(s->sys_strings_segment, SYS_STRING_PARSER_BASE);
// static VM/Kernel information:
retval->_kernel = s->_kernel;
assert(0 == retval->_kernel);
retval->_kernel = s->_kernel;
// s->_kernel = 0; // FIXME: We should set s->_kernel to 0 here,
// else it could be freed when the old EngineState is freed. Luckily, this freeing currently
// never happens, so we don't need to.