fracplanet crashes on second generate button click

Bug #1881296 reported by Kevin Shepherd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fracplanet (Ubuntu)
New
Undecided
Unassigned

Bug Description

To reproduce:
- Launch fracplanet
- click the "Generate" button
- wait a second or so until it has finished
- click the "Generate" button
  ** crash to desktop SIGSEGV

The cause:
messages in the queue arriving for the viewer after it has been deleted.

To fix:
In file: fracplanet_main.cpp function: FracplanetMain::regenerate()
Comment out:
 viewer.reset();
and put
if (!viewer)
on the line before:
  viewer.reset(new TriangleMeshViewer(this,&parameters_render,std::vector<const TriangleMesh*>(),_verbose));

Your regenerate() function should now start like this:
void FracplanetMain::regenerate() //! \todo Should be able to retain ground or clouds
{
  const bool first_viewer=!viewer;

  if (viewer)
    {
      viewer->hide();
// viewer.reset();
    }

  meshes.clear();
  mesh_terrain.reset();
  mesh_cloud.reset();

  //! \todo Recreating viewer every time seems like overkill, but Ubuntu (in VM) doesn't seem to like it otherwise.
  if (!viewer)
    viewer.reset(new TriangleMeshViewer(this,&parameters_render,std::vector<const TriangleMesh*>(),_verbose));

  // Tweak viewer appearance so controls not too dominant
  QFont viewer_font;

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.