c++ - Gsv::buffer error -
in c++ project, want use gsv::buffer gtksourceview library. declare buffer this:
glib::refptr<gsv::buffer> buffer;
i create :
buffer->create();
but when want use inherited fonction gtk::buffer:
buffer->set_text("somethings");
the executable exit , return:
erreur de segmentation (core dumped)
what problem?
thanks help
you create pointer, don't make point anywhere. in essence, buffer
null pointer.
from the refptr
default constructor refernece:
afterwards null , use of
->
cause segmentation fault.
you need explicitly create object pointed to, using static
gsv::buffer::create
function, e.g.
glib::refptr<gsv::buffer> buffer = gsv::buffer::create();
Comments
Post a Comment