Re: How many times can I call gtk_label_set_markup()?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, ALL,
This is the last report from valgrind:

==26002== Invalid write of size 4
==26002==    at 0x4C64A25: g_source_get_current_time (in
/usr/lib/libglib-2.0.so.0.1800.4)
==26002==    by 0x4C64AE6: (within /usr/lib/libglib-2.0.so.0.1800.4)
==26002==  Address 0xbe00ee08 is not stack'd, malloc'd or (recently) free'd

Is g_source_get_current_time() writes something?

Thank you guys. I learned a lot from this thread.

On Fri, Apr 8, 2011 at 1:33 PM, Igor Korot <ikorot01@xxxxxxxxx> wrote:
> Hi, Robert,
>
> On Fri, Apr 8, 2011 at 1:11 PM, Robert Pearce <rob@xxxxxxxxxxxxxxxxxxxx> wrote:
>> On Fri, 8 Apr 2011, Igor Korot <ikorot01@xxxxxxxxx> wrote :
>>>
>>> And the first time I am using this function is in this code:
>>
>>>
>>
>>> data1 = gtk_label_new( NULL );
>>
>>> gtk_label_set_markup( GTK_LABEL( data1 ), m_data1->str );
>>
>>> g_free( m_data1->str );
>>
>> ^^^^^^^^^^^^^^^^^^^^^^^^
>> Really? What is m_data1? Your earlier extract suggests you reuse it after
>> this.
>
> By doing g_free() I'm giving anownership of the markup string to the control.
> Or I don't need this?
>
> Thank you.
>
>>>
>>> gtk_table_attach( GTK_TABLE( table ), data1, 0, 1, 1, 2, GTK_EXPAND,
>>
>>> GTK_EXPAND, 0, 0 );
>>
>>> gtk_widget_show( data1 );
>>
>>
>> --
>> Rob Pearce                       http://www.bdt-home.demon.co.uk
>>
>> The contents of     | All power corrupts, but we need electricity.
>> this message are    |
>> purely my opinion.  |
>> Don't believe a     |
>> word.               |
>> _______________________________________________
>> gtk-list mailing list
>> gtk-list@xxxxxxxxx
>> http://mail.gnome.org/mailman/listinfo/gtk-list
>>
>
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list



[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux