memory allocation in GLIB
- From: Jim Parker <hopeye cfl rr com>
- To: gtk-app-devel-list gnome org
- Subject: memory allocation in GLIB
- Date: Mon, 10 Mar 2003 09:10:22 -0500
G'Day !
I have a problem (SEGFAULT) when freeing a vector allocated using
routines in GLIB (version 1.2.10).
I declare my variable as:
gfloat *vector;
I then allocate memory as:
vector = g_malloc ( (some_int)*sizeof(gfloat) );
This allows me to access the memory using:
for (i=0; i<(some_int); i++) vector[i] = some_float;
then when exiting the function, I free the memory using:
g_free( vector );
This statement causes a SEGFAULT. Can anyone suggest what I am doing
wrong.
TIA
cheers,
Jim Parker
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]