Forum > General

FreeMem question

(1/3) > >>

xinyiman:
I own a string in memory allocated by a DLL written in C and assigned to a PChar the ShowMessage () I can see correct values. The only thing I can do is to free the memory area occupied. So I decided to use the passing FreeMem PChar but I SIGSERV returns an error. Does anyone know how to address the problem?  :)

JuhaManninen:
You can't free the memory allocated by a DLL. The DLL must do it.

Juha

xinyiman:

--- Quote from: JuhaManninen on June 28, 2010, 12:04:18 am ---You can't free the memory allocated by a DLL. The DLL must do it.

Juha


--- End quote ---
Ok, I had thought about but I can not get it, I PChar the revision to a hypothetical function that is called

void LiberaStringa(char * variabile)
{
    free(variabile);
}

But it works!

JuhaManninen:

--- Quote from: xinyiman on June 28, 2010, 12:14:10 am ---void LiberaStringa(char * variabile)
{
    free(variabile);
}

--- End quote ---

If the function is in the DLL, then it works. Yes. It has a different memory manager and address space than your program.

Juha

xinyiman:

--- Quote from: JuhaManninen on June 28, 2010, 01:57:33 am ---
--- Quote from: xinyiman on June 28, 2010, 12:14:10 am ---void LiberaStringa(char * variabile)
{
    free(variabile);
}

--- End quote ---

If the function is in the DLL, then it works. Yes. It has a different memory manager and address space than your program.

Juha


--- End quote ---
I can not understand, but does not work, it is a dll that I'm writing with devcpp. And your last message is not clear!

Navigation

[0] Message Index

[#] Next page

Go to full version