Commits

shuerhaaken  committed 23aa3bc

make sure destructor is called from C binding

  • Participants
  • Parent commits 3efa146

Comments (0)

Files changed (6)

+commit 3efa146cca9c505c84f55876a0cc1d2f648c0149
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Tue Jul 2 09:50:22 2013 +0200
+
+    add homepage accessor for vapi
+
 commit 9f7405b4a080db72811bbaf97deab5cb0e836ada
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Tue Jul 2 09:48:00 2013 +0200

File bindings/c/taginfo_c.cc

 }
 
 void taginfo_image_free(TagInfo_Image * img) {
-    delete img;
+    if(!img)
+        return;
+    Image *i = reinterpret_cast<Image *>(img);
+    delete i;
 }
 
 void taginfo_image_array_free(TagInfo_Image ** img_arr) {

File bindings/c/taginfo_c.h

 
 typedef struct { 
     char *                  data;
-    int                     data_length;
+    unsigned long           data_length;
     TagInfo_ImageType       image_type;
     TagInfo_ImageFileType   image_file_type;
 } TagInfo_Image;

File bindings/vala/libtaginfo_c.vapi

 	[Compact]
 	public class Image
 	{
-		[CCode (array_length_cname = "data_length")]
-		public char[] data;
+		[CCode (array_length_cname = "data_length", array_length_type = "ulong")]
+		public uint8[] data;
 		public ImageType image_type;
 		public ImageFileType image_file_type;
 	}

File libtaginfo/Makefile.am

     asfinfo.cc \
     flacinfo.cc \
     id3_common.cc \
+    image.cc \
     info.cc \
     mp3info.cc \
     mp4_common.cc \

File libtaginfo/taginfo.h

         IMAGE_TYPE_PUBLISHER_LOGO
     };
     
+    
     class Image {
         public:
-//            Image();
-//            ~Image();
+            
+            Image();
+            ~Image();
+            
             char *        data;
-            int           data_length;
+            ulong         data_length;
             ImageType     image_type;
             ImageFileType image_file_type;
     };
     
+    
     class Info {
         protected :
             TagLib::FileRef * taglib_fileref;