fixed logging
[swftools.git] / lib / devices / record.c
index a4b0859..f0b70f6 100644 (file)
@@ -348,7 +348,7 @@ static void record_fillgradient(struct _gfxdevice*dev, gfxline_t*line, gfxgradie
 static void record_addfont(struct _gfxdevice*dev, gfxfont_t*font)
 {
     internal_t*i = (internal_t*)dev->internal;
-    msg("<trace> record: %08x ADDFONT %s\n", dev);
+    msg("<trace> record: %08x ADDFONT %s\n", dev, font->id);
     if(font && !gfxfontlist_hasfont(i->fontlist, font)) {
        writer_writeU8(&i->w, OP_ADDFONT);
        dumpFont(&i->w, font);
@@ -415,17 +415,7 @@ static void replay(struct _gfxdevice*dev, gfxdevice_t*out, void*data, int length
        unsigned char op = reader_readU8(r);
        switch(op) {
            case OP_END:
-               r->dealloc(r);
-
-               {
-                   gfxfontlist_t*l = fontlist;
-                   while(l) {
-                       l = l->next;
-                   }
-               }
-
-               gfxfontlist_free(fontlist, 1);
-               return;
+               goto finish;
            case OP_SETPARAM: {
                msg("<trace> replay: SETPARAM");
                char*key;
@@ -557,7 +547,9 @@ static void replay(struct _gfxdevice*dev, gfxdevice_t*out, void*data, int length
            }
        }
     }
-    msg("<error> No END token in gfx recording");
+finish:
+    r->dealloc(r);
+    gfxfontlist_free(fontlist, 1);
 }
 void gfxresult_record_replay(gfxresult_t*result, gfxdevice_t*device)
 {