From: kramm <kramm>
Date: Thu, 8 Apr 2004 08:54:39 +0000 (+0000)
Subject: FoldAll is now done in SWF.c
X-Git-Tag: stable_core_1~5
X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=6d72eaadfcc19eb917ca15ada059210e2b63a91f;p=swftools.git

FoldAll is now done in SWF.c
---

diff --git a/lib/python/taglist.c b/lib/python/taglist.c
index 8b4acf1..7e101c8 100644
--- a/lib/python/taglist.c
+++ b/lib/python/taglist.c
@@ -29,22 +29,19 @@ PyObject * taglist_new2(TAG*tag)
     mylog("+%08x(%d) taglist_new2 tag=%08x", (int)taglist, taglist->ob_refcnt, tag);
     PyObject* tagmap = tagmap_new();
 
-    swf_FoldAllTags(tag);
-
-    int nr=0;
+    int nr=0, len=0;
     TAG*t = tag;
     TAG*last = t;
-    while(t) {nr++;last=t;t=t->next;}
+    while(t) {len++;last=t;t=t->next;}
 
     if(last && last->id==ST_END) {
-	swf_DeleteTag(last);
-	nr--;
+	swf_DeleteTag(last); last = 0;
+	len--;
+	if(len==0) tag = 0;
     }
 
-    taglist->taglist = PyList_New(nr);
+    taglist->taglist = PyList_New(len);
     
-    mylog("+%08x(%d) taglist_new2: %d items", (int)taglist, taglist->ob_refcnt, nr);
-
     nr = 0;
     t = tag;
     while(t) {