Skip to content
Snippets Groups Projects
Commit 267844ab authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix memory leak

parent 1e020f4c
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,7 @@ void drawContext::load(std::string filename)
// restore default options
GmshRestoreDefaultOptions();
GmshSetOption("General", "Terminal", 1.0);
// open the file with Gmsh
GmshOpenProject(filename);
......@@ -626,6 +627,7 @@ void drawContext::drawView()
checkGlError("Initialize position");
glEnable(GL_DEPTH_TEST);
drawMesh();
checkGlError("Draw mesh");
drawGeom();
......
......@@ -10,6 +10,7 @@
drawString::drawString(std::string text, int size, float color[4])
{
_map = 0;
_size = size;
if(color == NULL)
setColor(0.0f, 0.0f, 0.0f, 1.0f);
......
......@@ -381,10 +381,11 @@ void getBitmap(void *self, const char *text, int textsize, unsigned char **map,
i=2;
while(i<*height) i*=2;
*height = i;
UIGraphicsBeginImageContextWithOptions(CGSizeMake(*width, *height), NO, 0.0);
[lbl.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
CGImageRef bitmap = [img CGImage];
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
unsigned char *rawData = (unsigned char*) calloc(*height * *width * 4, sizeof(unsigned char));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment