Re: Completely remove a GtkWidget from Memory
- From: "Pawel S. Veselov" <Pawel Veselov Sun COM>
- To: Andreas KÃhler <andi5 py gmx net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Completely remove a GtkWidget from Memory
- Date: Thu, 7 Aug 2003 15:11:16 -0700
On Fri, Aug 08, 2003 at 12:05:05AM +0200, Andreas KÃhler wrote:
if ((ptr = malloc(size)) != NULL) {
free(ptr); if (ptr == NULL) {
/* you have a really freaky problem ;-) */
}
}
i am so sorry, maybe it is because i am a newbie, but why should ptr be
NULL after "free (ptr)"? i thought free cannot change the the address
ptr is pointing to, since it does not know the address of it...
please help me ;-(
I didn't catch the start of this thread, but it is right, that
free(ptr) would not change the value of ptr. That's why usually
calling subsequent free() on already freed memory cause memory
corruption rather than sigsegvs.
The only exception would be the case if your free() is actually
a macro.
--
Pawel.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]