Canvas: Make path destroying more robust
This commit is contained in:
parent
5ac3de21e3
commit
37d0c19f7c
1 changed files with 19 additions and 2 deletions
|
@ -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"; }
|
||||
|
|
Loading…
Add table
Reference in a new issue