[Rhythmbox-devel] Segmentation fault during property read
- From: "Bartosz Wiklak" <bwiklak gmail com>
- To: "Rhythmbox-devel list" <rhythmbox-devel gnome org>, grzesiof gmail com
- Subject: [Rhythmbox-devel] Segmentation fault during property read
- Date: Mon, 3 Mar 2008 22:16:17 +0100
Hi, I'm doing something like that:
RBSource *source;
RhythmDBQueryModel *model;
RhythmDBEntry *entry1;
GtkTreeIter iter;
gboolean valid;
gchar buff[1024];
if(plugin->shell==NULL) g_print("NIC\n");
g_object_get (plugin->shell, "selected-source", &source, NULL);
g_object_get (source, "query-model", &model, NULL);
allSongsList = (SongInfo*)g_malloc( covers_count*sizeof(SongInfo) );
valid = gtk_tree_model_get_iter_first (model, &iter);
covers_count=0;
while (valid)
{
gchar *str_album = NULL;
gchar *str_artist = NULL;
gtk_tree_model_get (model, &iter, 0, &entry1,-1);
str_album = rhythmdb_entry_get_string(entry1,RHYTHMDB_PROP_ALBUM);
str_artist = rhythmdb_entry_get_string(entry1,RHYTHMDB_PROP_ARTIST);
if(str_artist){
allSongsList[covers_count].songPath =
rhythmdb_entry_get_string(entry1,RHYTHMDB_PROP_LOCATION);
allSongsList[covers_count].coverPath= (gchar*)g_malloc( strlen(buff)+1 );
strcpy(allSongsList[covers_count].coverPath,buff);
g_print(allSongsList[covers_count].songPath);
}
valid = gtk_tree_model_iter_next (model, &iter);
covers_count++;
}
When I'm tying to get file location (RHYTHMDB_PROP_LOCATION) I'm
getting segmentation fault.
What is wrong?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]