]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/picomodel/lwo/clip.c
Merge commit 'aa4bc3893f6c0c360c91896eba46631e53b2f0d1' into master-merge
[xonotic/netradiant.git] / libs / picomodel / lwo / clip.c
index 97f2973d3cdcb3b4d7acf1b701b373d298c70981..6a347f585a8cddea2f47a84dab0bf128306fd9fd 100644 (file)
 
 void lwFreeClip( lwClip *clip ){
        if ( clip ) {
-               lwListFree( (void*) clip->ifilter, lwFreePlugin );
-               lwListFree( (void*) clip->pfilter, lwFreePlugin );
+               lwListFree(clip->ifilter, (void (*)(void *)) lwFreePlugin);
+               lwListFree(clip->pfilter, (void (*)(void *)) lwFreePlugin);
+
+               switch ( clip->type ) {
+               case ID_STIL:
+                       _pico_free( clip->source.still.name );
+                       break;
+
+               case ID_ISEQ:
+                       _pico_free( clip->source.seq.prefix );
+                       _pico_free( clip->source.seq.suffix );
+                       break;
+
+               case ID_ANIM:
+                       _pico_free( clip->source.anim.name );
+                       _pico_free( clip->source.anim.server );
+                       _pico_free( clip->source.anim.data );
+                       break;
+
+               case ID_XREF:
+                       _pico_free( clip->source.xref.string );
+                       break;
+
+               case ID_STCC:
+                       _pico_free( clip->source.cycle.name );
+                       break;
+
+               default:
+                       break;
+               }
+
                _pico_free( clip );
        }
 }
@@ -196,11 +225,11 @@ lwClip *lwGetClip( picoMemStream_t *fp, int cksize ){
                        filt->data = getbytes( fp, sz - rlen );
 
                        if ( id == ID_IFLT ) {
-                               lwListAdd( &clip->ifilter, filt );
+                               lwListAdd( (void *) &clip->ifilter, filt );
                                clip->nifilters++;
                        }
                        else {
-                               lwListAdd( &clip->pfilter, filt );
+                               lwListAdd( (void *) &clip->pfilter, filt );
                                clip->npfilters++;
                        }
                        break;