Ok, I found the problem, but don't know how to solve it.

The problem is when I try to delete the backup. But I guess that when I call the DmDeleteDataabase it doesn't delete it at that moment, because it updates the gui (is there any OS thread running in the background to acomplish these kind of tasks?). If I remove that part of the code (removing the old app) there is no error. Then, using an utility called FileProg I try to manually remove the backup and then I get the error "Memory Mgr.c, Line:3654, Free handle", just the same error I get if I uncomment the part of my code that removes the backup.

Is there anything else I should do before removing the recently renamed application? It doesn't happen on treo 650 or POSE 3.5 running Palm OS 4.1.2

Thanks in advance

Miguel Angel Sotomayor Hernandez wrote:



Logan Shaw wrote:

What about using DmSetDatabaseInfo() to rename the app's database
(and change its creator code), rather than trying to copy it and then
delete it?

I'm doing this and facing a problem in tungsten E and C. When I replace the app by: 1. renaming existing App, and 2. deleting old app after sucessfully installing the new one, I get an Free Handle error. If the new application is corrupted (I tested using an invalid prc) I get the old one working fine.

Even when the app crashes after updating the app, I get the new version installed and working properly. Actually this error ocurs somewhere after my updating function and the calling function (the event handler) end.

It works fine on treo 650 and the PalmOS Emulator, running a Palm OS 4.0 rom I have no way (at this moment) to debug my app in other than the old POSE.

Any Idea? here a snippet of my code:

LocalID idDB=0;
UInt32 appCreatorO = '5CHK';
UInt32 appCreatorB = '5CHB';
idDB = DmFindDatabase(0, "Storecheck");

/* Crea un respaldo antes de substituir la aplicación */
if(idDB)
DmSetDatabaseInfo (0, idDB, "Storecheck-Bck", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &appCreatorB);

DmDeleteDatabase(0, idDB);

if(InstalaAplicacion(3)!= errNone){
   /* Restaura el respaldo */
   LocalID idDBBck=0;

   idDBBck = DmFindDatabase(0, "Storecheck-Bck");
   if(idDBBck)
DmSetDatabaseInfo (0, idDBBck, "Storecheck", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &appCreatorO);

   FrmAlert(InstalacionAlert);
   AbreFormaPrincipal();

}else{
   /* Borra el respaldo */

   LocalID idDBBck=0;
   idDBBck = DmFindDatabase(0, "Storecheck-Bck");
   if(idDBBck)
       DmDeleteDatabase(0, idDBBck);

   gLibPreferencias.fechaActualizacion=gLibFechaActual;
   AbreFormaPrincipal();
   MensajeProgreso("Actualizaci\363n exitosa","","");
}


Thanks
Miguel


--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to