|
From: Luca C. <ce...@sy...> - 2013-05-20 16:21:46
|
Hi, I was working with the awesome X3D_get[type] and X3D_new[type] functions that make easy to translate values in and out the EAI channel when I've noticed what can be a bug. First of all, the X3D_freeNode function \src\libeai\EAI_C_Field.c -> line 38 works well for all the SF types, but it seems to me that does wrong the freeing of the MF types. In fact for almost all the MF types deallocates only the node->X3D_MFInt32.p pointer (line 73-82) , even if the struct allocates other types. The second problem lies in some X3D_new[type] functions that seem to allocate the wrong type. For instance X3D_newMFVec3f(int num, float(* array)[3]) \src\libeai\EAI_C_Field.c -> line 325 instead of allocating space for "n" _intX3D_SFVec3f and passing the address to the internal member X3D_MFVec3f.p allocates space for "n" X3DNode retval->X3D_MFVec3f.p = malloc (sizeof(X3DNode) * num); [line 332] I hope this could be useful. -- =============================================================== Luca Cerutti Profutura s.r.l. - Corso Tortona 17 - 10153 Torino phone: +39 (0)11 8392363 - fax: +39 (0)11 837802 e-mail: ce...@sy... http://www.synarea.com Le informazioni, i dati e le notizie contenute nella presente comunicazione e i relativi allegati sono di natura privata e come tali possono essere riservate e sono, comunque, destinate esclusivamente ai destinatari indicati in epigrafe. La diffusione, distribuzione e/o la copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p., sia ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di darcene immediata comunicazione anche inviando un messaggio di ritorno all’indirizzo e-mail del mittente. This e-mail (including attachments) is intended only for the recipient(s) named above. It may contain confidential or privileged information and should not be read, copied or otherwise used by any other person. If you are not the named recipient, please contact (ce...@sy...) and delete the e-mail from your system. Rif. D.L. 196/2003. =============================================================== |