mirror of
https://github.com/leozide/leocad
synced 2025-01-27 19:58:20 +01:00
Fixed invalid memory free.
This commit is contained in:
parent
54beb09a97
commit
7e2180e132
3 changed files with 15 additions and 3 deletions
|
@ -48,16 +48,27 @@ public:
|
|||
mInputState.Shift = false;
|
||||
mInputState.Alt = false;
|
||||
mContext = new lcContext();
|
||||
mDeleteContext = true;
|
||||
}
|
||||
|
||||
virtual ~lcGLWidget()
|
||||
{
|
||||
delete mContext;
|
||||
if (mDeleteContext)
|
||||
delete mContext;
|
||||
}
|
||||
|
||||
void* GetExtensionAddress(const char* FunctionName);
|
||||
void ShowPopupMenu();
|
||||
|
||||
void SetContext(lcContext* Context)
|
||||
{
|
||||
if (mDeleteContext)
|
||||
delete mContext;
|
||||
|
||||
mContext = Context;
|
||||
mDeleteContext = false;
|
||||
}
|
||||
|
||||
void MakeCurrent();
|
||||
void Redraw();
|
||||
void CaptureMouse();
|
||||
|
@ -83,6 +94,7 @@ public:
|
|||
int mCursorType;
|
||||
void* mWidget;
|
||||
lcContext* mContext;
|
||||
bool mDeleteContext;
|
||||
};
|
||||
|
||||
#endif // _LC_GLWIDGET_H_
|
||||
|
|
|
@ -3340,7 +3340,7 @@ void Project::CreateImages(Image* images, int width, int height, unsigned short
|
|||
view.SetCamera(m_ActiveView->mCamera, false);
|
||||
view.mWidth = width;
|
||||
view.mHeight = height;
|
||||
view.mContext = gMainWindow->mPreviewWidget->mContext;
|
||||
view.SetContext(gMainWindow->mPreviewWidget->mContext);
|
||||
|
||||
if (!hilite)
|
||||
SelectAndFocusNone(false);
|
||||
|
|
|
@ -807,7 +807,7 @@ void lcQMainWindow::print(QPrinter *printer)
|
|||
view.SetCamera(project->GetActiveView()->mCamera, false);
|
||||
view.mWidth = tileWidth;
|
||||
view.mHeight = tileHeight;
|
||||
view.mContext = piecePreview->widget->mContext;
|
||||
view.SetContext(piecePreview->widget->mContext);
|
||||
|
||||
GL_BeginRenderToTexture(tileWidth, tileHeight);
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
|
|
Loading…
Add table
Reference in a new issue