*/
GLViewer_MarkerSet::~GLViewer_MarkerSet()
{
- if ( myXCoord )
- delete[] myXCoord;
- if ( myYCoord )
- delete[] myYCoord;
+ delete[] myXCoord;
+ delete[] myYCoord;
+
+ myXCoord = nullptr;
+ myYCoord = nullptr;
}
/*!
*/
void GLViewer_MarkerSet::setXCoord( GLfloat* xCoord, int size )
{
+ delete[] myXCoord;
+ myXCoord = nullptr;
+
myXCoord = new GLfloat[ size ];
for( int i = 0; i < size; i++ )
myXCoord[i] = xCoord[i];
*/
void GLViewer_MarkerSet::setYCoord( GLfloat* yCoord, int size )
{
+ delete[] myYCoord;
+ myYCoord = nullptr;
+
myYCoord = new GLfloat[ size ];
for( int i = 0; i < size; i++ )
myYCoord[i] = yCoord[i];
*/
GLViewer_Polyline::~GLViewer_Polyline()
{
- if ( myXCoord )
- delete[] myXCoord;
- if ( myYCoord )
- delete[] myYCoord;
+ delete[] myXCoord;
+ delete[] myYCoord;
+
+ myXCoord = nullptr;
+ myYCoord = nullptr;
}
/*!
GLViewer_Drawer* GLViewer_Polyline::createDrawer()
{
// cout << "GLViewer_MarkerSet::createDrawer" << endl;
- return myDrawer = new GLViewer_PolylineDrawer();
+ delete myDrawer;
+ myDrawer = nullptr;
+ return myDrawer = new GLViewer_PolylineDrawer();
}
/*!
*/
void GLViewer_Polyline::setXCoord( GLfloat* xCoord, int size )
{
+ delete[] myXCoord;
+ myXCoord = nullptr;
+
myXCoord = new GLfloat[ size ];
for( int i = 0; i < size; i++ )
myXCoord[i] = xCoord[i];
*/
void GLViewer_Polyline::setYCoord( GLfloat* yCoord, int size )
{
+ delete[] myYCoord;
+ myYCoord = nullptr;
+
myYCoord = new GLfloat[ size ];
for( int i = 0; i < size; i++ )
myYCoord[i] = yCoord[i];
{
public:
GLViewer_Polyline( int number = 1, float size = 5.0, const QString& toolTip = "GLPolyline" );
- ~GLViewer_Polyline();
+ virtual ~GLViewer_Polyline();
// redefined methods
virtual void compute();
*/
GLViewer_Context::~GLViewer_Context()
{
- myActiveObjects.clear();
- myInactiveObjects.clear();
- mySelectedObjects.clear();
+ qDeleteAll(myActiveObjects);
+ myActiveObjects.clear();
+
+ qDeleteAll(myInactiveObjects);
+ myInactiveObjects.clear();
+
+ mySelectedObjects.clear();
}
/*!
object->highlight( x, y, myTolerance, GL_FALSE );
isHigh = object->isHighlighted();
}
+ delete rect;
+ rect = nullptr;
if( isHigh )
{
myIsHigh = GL_FALSE;
myIsSel = GL_FALSE;
- myRect = new GLViewer_Rect();;
- myUpdateRect = new GLViewer_Rect();;
+ myRect = new GLViewer_Rect();
+ myUpdateRect = new GLViewer_Rect();
myGLText = new GLViewer_Text( 0, 0, 0, QColor(0,0,0) );
myAspectLine = new GLViewer_AspectLine();
*/
GLViewer_Object::~GLViewer_Object()
{
- if( myRect )
- delete myRect;
+ delete myRect;
+ myRect = nullptr;
- if( myUpdateRect )
- delete myUpdateRect;
+ delete myUpdateRect;
+ myUpdateRect = nullptr;
- if( myGLText )
- delete myGLText;
+ delete myGLText;
+ myGLText = nullptr;
- if( myAspectLine )
- delete myAspectLine;
+ delete myAspectLine;
+ myAspectLine = nullptr;
+
+ delete myOwner;
+ myOwner = nullptr;
}
/*!
{
//myGLSketcher = 0;
//delete myGLSketcher;
+
+ qDeleteAll(myDrawers);
+ myDrawers.clear();
+
+ delete myGLContext;
+ myGLContext = nullptr;
+
GLViewer_TexFont::clearTextBases();
}