Journaling fixes.

This commit is contained in:
Jonathan Moore Liles 2008-05-07 10:19:55 -05:00
parent aca45eceab
commit 1edc236960
1 changed files with 5 additions and 8 deletions

View File

@ -283,12 +283,13 @@ Loggable::do_this ( const char *s, bool reverse )
char classname[40]; char classname[40];
char command[40]; char command[40];
char *arguments; char *arguments = NULL;
const char *create, *destroy; const char *create, *destroy;
if ( reverse ) if ( reverse )
{ {
// sscanf( s, "%s %*X %s %*[^\n<]<< %a[^\n]", classname, command, &arguments );
sscanf( s, "%s %*X %s%*[^\n<]<< %a[^\n]", classname, command, &arguments ); sscanf( s, "%s %*X %s%*[^\n<]<< %a[^\n]", classname, command, &arguments );
create = "destroy"; create = "destroy";
destroy = "create"; destroy = "create";
@ -309,11 +310,7 @@ Loggable::do_this ( const char *s, bool reverse )
hack. Would it be better to queue up objects for deletion hack. Would it be better to queue up objects for deletion
(when?) */ (when?) */
if ( l ) if ( l )
{
int id = l->id();
delete l; delete l;
_loggables[ id ] = NULL;
}
} }
else if ( ! strcmp( command, "set" ) ) else if ( ! strcmp( command, "set" ) )
{ {
@ -439,7 +436,7 @@ Loggable::undo ( void )
if ( *s == '\t' ) if ( *s == '\t' )
s++; s++;
DMESSAGE( "undoing \"%s\"\n", s ); DMESSAGE( "undoing \"%s\"", s );
do_this( s, true ); do_this( s, true );
@ -729,7 +726,7 @@ Loggable::log_destroy ( void ) const
/* tearing down... don't bother */ /* tearing down... don't bother */
return; return;
log( "%s 0x%X destroy (nothing) << ", class_name(), _id ); log( "%s 0x%X destroy << ", class_name(), _id );
char **sa; char **sa;