bytebrew / slope

C/Gtk+ data visualization library.
GNU Lesser General Public License v3.0
102 stars 16 forks source link

Segmentation fault when destroying chart #2

Closed Dalan94 closed 9 years ago

Dalan94 commented 9 years ago

I noticed that there is a segmentation fault when I use the slope_chart_destroy function. This occurred when destroying the legend with the slope_item_destroy function. I solved the bug by adding this in the slope_legend_create function.

parent->name = NULL;
parent->metrics = NULL;

I don't know if it's a good idea. I let you see.

elvismt commented 9 years ago

It seems right. parent->name and parent->metrics are not not used by the legend, and the way you prevented the leak is right. I think i have never noticed this bug because in my test apps the legend was destroyed in the application exit time, and the segfault passed unseen. Good job. thanks.

[image: LSBD] http://www.lsbd.ufc.br/

Elvis Teixeira

DEVELOPER

[image: LSBD]elvis.teixeira@lsbd.ufc.br

[image: LSBD]+55 (85) 3366 9235

[image: LSBD]+55 (85) 9135 3008

[image: LSBD]elvis.teixeira

On Wed, Jun 24, 2015 at 7:32 PM, Dalan94 notifications@github.com wrote:

I noticed that there is a segmentation fault when I use the slope_chart_destroy function. This occurred when destroying the legend with the slope_item_destroy function. I solved the bug by adding this in the slope_legend_create function.

parent->name = NULL; parent->metrics = NULL;

I don't know if it's a good idea. I let you see.

— Reply to this email directly or view it on GitHub https://github.com/elvismt/slope/issues/2.