J'ai ce code. le pointeur tourne 0x0 immédiatement avant de l'utiliser. Bref avant, il avait la bonne adresse. J'utilise Gtkmm 2.4, mais il renvoie la valeur attendue, il tourne juste 0x0. Qu'est-ce qui ne va pas?Pointer instantanément 0x0
gdb preuve:
151 col = preview->get_column(pcFolder); /* col = 0x7fff5fc404a0 */
(gdb) print col
$1 = ('Gtk::TreeViewColumn' *) 0x7fff5fc404a0
(gdb) print *col
warning: can't find linker symbol for virtual table for `Gtk::TreeViewColumn' value
$2 = {
<Gtk::Object> = {
<Glib::Object> = {
<Glib::ObjectBase> = <invalid address>,
members of Glib::Object:
_vptr$Object = 0x7fff5fc06a20,
static object_class_ = {<No data fields>}
},
members of Gtk::Object:
static object_class_ = {<No data fields>},
referenced_ = 21,
gobject_disposed_ = 60
},
members of Gtk::TreeViewColumn:
static treeviewcolumn_class_ = {<No data fields>}
}
(gdb) next
152 col->set_resizable(true); /* col = 0x0 */
(gdb) print col
$3 = ('Gtk::TreeViewColumn' *) 0x0
(gdb) print *col
Cannot access memory at address 0x0
(gdb) next
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000001000edc68 in Gtk::TreeViewColumn::set_resizable()
Je ne sais pas ce qui cause ce phénomène. as-tu?
Solution: en lisant la documentation. la fonction retour pcFolder compte de 1, get_column() de 0.
À quoi ressemble 'get_column'? – Nim
http://library.gnome.org/devel/gtkmm/2.22/classGtk_1_1TreeView.html#a513e50ad0acdd817d1a443f1eaa3debe – M3t0r