<div>I can;t say what the leak will be from the code supply but I can say that creating a dedicated viewer, rendering a frame, then destroying really isn't an efficient way to go about generating a thumbnail image.  Rather than than debug a dubious approach I'd suggest you leave it and try another lighter weight approach.</div><div><br></div><div>The best approach is something I can't say at this point as I don't know enough about your application and your needs for generating a thumbnail.  Is it a one off activity, something you do offline, something that is done occasionally?  How to go about things depends upon your usage case.</div><div><br></div><div>As a general comment, creating an destroying objects on OpenGL and consequently the OSG is expensive.  It's far better to create once and reuse, even if you don't reuse often.</div><div><br></div><div>Also creating separate graphics context is very expensive, if you already have a graphics context then the best thing to do for offscreen rendering is to your a frame buffer object and render to texture.  This way you can minimize the amount of new GL objects being created for the task,  W.r.t running in a background thread, OpenGL isn't a multi-threaded API, you can only multi-thread with multiple graphics context with t a thread per context.  It's only really suitable for mulitple GPU tasks.  It's typically far better to just add the work to the standard frame and run it as part of your normal viewer.</div><div><br></div><div>With the OSG you can toggle on/off render to texture by setting the NodeMask of an osg::Camera.</div><div><br></div><div><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/a8394d4f-92a9-4736-b51f-34b5cf5bee9fn%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/a8394d4f-92a9-4736-b51f-34b5cf5bee9fn%40googlegroups.com</a>.<br />