Commit 9893ed0c authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

check return values

parent 1854839e
......@@ -132,8 +132,9 @@ bool imageSGI::save(const imageStruct&image, const std::string&filename, const s
image.convertTo(&img, GL_RGBA);
unsigned int32*data=(unsigned int32*)img.data;
std::string name="Gem image";
props.get("imagename", name);
std::string name="";
if (!props.get("imagename", name))
name = std::string("Gem image");
int result=0;
if(data)result=longstoimage(data, img.xsize, img.ysize, 4, filename.c_str(), name.c_str());
......
......@@ -964,10 +964,17 @@ void gemglxwindow :: destroy(void)
if (m_pimpl->win) {
XUnmapWindow (m_pimpl->dpy, m_pimpl->win);
err=XDestroyWindow(m_pimpl->dpy, m_pimpl->win);
if(err) {
verbose(1, "XDestroyWindow returned %d", err);
}
}
if (m_pimpl->cmap)
if (m_pimpl->cmap) {
err=XFreeColormap(m_pimpl->dpy, m_pimpl->cmap);
if(err) {
verbose(1, "XFreeColormap returned %d", err);
}
}
XFlush( m_pimpl->dpy );
err=XCloseDisplay(m_pimpl->dpy); /* this crashes if no window is there */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment