Mercurial > hg > audiodb
comparison audioDB.cpp @ 577:a3d62f2f864f
Some memory-handling fixes
Free the correct bits of datum, not bits that have already been set to
NULL, after getting query results back (both in the command-line binary
and in the PD external).
In the external, free the results structure once the data has been
passed into the outlets.
author | mas01cr |
---|---|
date | Mon, 06 Jul 2009 15:26:24 +0000 |
parents | 048688d47697 |
children | 82d23418d867 |
comparison
equal
deleted
inserted
replaced
576:ae2eeec4d41d | 577:a3d62f2f864f |
---|---|
927 if(datum.data) { | 927 if(datum.data) { |
928 free(datum.data); | 928 free(datum.data); |
929 datum.data = NULL; | 929 datum.data = NULL; |
930 } | 930 } |
931 if(datum.power) { | 931 if(datum.power) { |
932 free(datum.data); | 932 free(datum.power); |
933 datum.data = NULL; | 933 datum.power = NULL; |
934 } | 934 } |
935 if(datum.times) { | 935 if(datum.times) { |
936 free(datum.data); | 936 free(datum.times); |
937 datum.data = NULL; | 937 datum.times = NULL; |
938 } | 938 } |
939 | 939 |
940 if(rs == NULL) { | 940 if(rs == NULL) { |
941 error("audiodb_query_spec failed"); | 941 error("audiodb_query_spec failed"); |
942 } | 942 } |