Re: How to detect if a glist->data is a GUINT_TO_POINTER for not freeing it ?
- From: Enrico TrÃger <enrico troeger uvena de>
- To: gtk-app-devel-list gnome org
- Subject: Re: How to detect if a glist->data is a GUINT_TO_POINTER for not freeing it ?
- Date: Fri, 21 Apr 2006 13:28:21 +0200
On Fri, 21 Apr 2006 13:01:10 +0200, Colossus <colossus 3000 it> wrote:
Enrico TrÃger wrote:
No, it is a simple decimal value. I appended the l to emphasise
that it is a long int. I'm not completely sure, but I think you can
safely omit it.
This is my code:
original = g_strndup ( start , end - start);
unsigned long long int *_original = g_malloc(sizeof(unsigned long
long int));
*_original = atoll (original);
g_free (original);
later I fill the GList:
archive->row = g_list_prepend (archive->row , _original) ;
Then in another file.c I have to fill the liststore by retrieving the
values from the GList:
gtk_list_store_set(GTK_LIST_STORE(list_store), &iter, i,
fields->data, -1);
And in this line I get the segfault ! Obviously I declared that
column as G_TYPE_UINT64;
It's related to the allocated u long long int pointer because if I
use GUINT_TO_POINTER with G_TYPE_UINT it works. Do you have any idea
about the crash ?
Not really, but perhaps a type cast helps?
I found that
http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
says something similar as in my first post.
regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.key
Geany, a lightweight IDE using GTK2 - http://geany.uvena.de
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]