Check the roam view before unprojecting
authorAndy Spencer <andy753421@gmail.com>
Thu, 16 Feb 2012 21:24:14 +0000 (21:24 +0000)
committerAndy Spencer <andy753421@gmail.com>
Thu, 16 Feb 2012 21:27:02 +0000 (21:27 +0000)
On win32 (and maybe others) the motion notify callback can occur before
the roam view is properly initialized.

src/grits-opengl.c

index 1b2cce9..0b4100a 100644 (file)
@@ -469,6 +469,8 @@ static void grits_opengl_unproject(GritsViewer *_opengl,
                gdouble *lat, gdouble *lon, gdouble *elev)
 {
        GritsOpenGL *opengl = GRITS_OPENGL(_opengl);
+       if (!opengl->sphere->view)
+               return;
        gdouble x, y, z;
        if (pz < 0) {
                gfloat tmp = 0;