1
0
Fork 0

Canvas: Make path destroying more robust

This commit is contained in:
Thomas Geymayer 2012-09-27 14:41:00 +02:00
parent 5ac3de21e3
commit 37d0c19f7c

View file

@ -56,8 +56,25 @@ namespace canvas
virtual ~PathDrawable()
{
vgDestroyPath(_path);
vgDestroyPaint(_paint);
if( !_vg_initialized )
{
if( _path != VG_INVALID_HANDLE )
SG_LOG
(
SG_GL,
SG_WARN,
"Can't destroy path without OpenVG context: "
<< _path_element->_node->getPath()
);
return;
}
if( _path != VG_INVALID_HANDLE )
vgDestroyPath(_path);
if( _paint != VG_INVALID_HANDLE )
vgDestroyPaint(_paint);
if( _paint_fill != VG_INVALID_HANDLE )
vgDestroyPaint(_paint_fill);
}
virtual const char* className() const { return "PathDrawable"; }