Diego Zabaleta writes:
>
> I believe that I am having some problem with the API of C.
> That you find the following test:
>
> I implement a program in C that the only thing that makes is to call a
> routine that obtains data of a chart every so often MySQL (ej: 10 seconds),
> continuing the it lines of the function that happens to you previously.
> The connection will liberate it when the program concludes.
> I will make that the program calls to the routine during a followed day, at
> the same time I examine the use by heart.
> Supposing that the routine in C that obtains the data of MySQL this well
> implemented one, the memory should be liberated after having completed each
> call. Correct?
>
> The function that I will use serious the following one:
>
> int DB_Existe_Id_Cliente (element *agente)
> MYSQL_RES *result;
> int retorno;
> MYSQL_ROW row;
>
> sprintf(query, SELECT yams FROM clients WHERE
> id=%d",agent->info.header.id_cliente);
> if ((retorno=mysql_query(connection,query)) != 0)
> return -1;
> result=mysql_store_result(connection);
>
> if (mysql_num_rows(result) == 0)
>
>
> mysql_free_result(result);
> return FALSE;
> }
>
> IF ((row=MYSQL_FETCH_ROW(result)) == NULL)
> return -3;
>
> strcpy(agente->info.header.nombre_cliente,row[0]);
> mysql_free_result(result);
> return TRUE;
> }
>
> Thanks.
> Diego.-
>
Hi!
Will you please explain how do you conclude that memory is not
released ??
You know that at the end of your program you have to call mysql_close
??
I would simply like to see how do you diagnose that memory is not
released ??
Regards,
Sinisa
____ __ _____ _____ ___ == MySQL AB
/*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped
/*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus
/*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
/*/ \*\ Developers Team