Mac: Invalid memory access of location when calling stage.hide()

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 8
    • Affects Version/s: fx2.1
    • Component/s: javafx
    • Environment:

      OSX JDK 7 update 4. Using JavaFX 2.1 that shipped with it.

      If you run the following code (with the environment specified below) and do "cmd-w" which should close the stage, I get the error "Invalid memory access of location 0x0 rip=0x7fff8b05be90" and the application crashes. I've seen the JVM seg fault as well. If you close the new frame just by clicking on the red close button, it works fine. Or if you do "cmd-q" it closes fine.


      import javafx.application.Application;
      import javafx.event.EventHandler;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.input.KeyEvent;
      import javafx.stage.Stage;

      public class StageTest extends Application {
          @Override
          public void start(Stage stage) throws Exception {
              createScene();
          }

          public void createScene() {
              final Stage stage = new Stage();
              Group g = new Group();
              Scene s = new Scene(g, 500, 500);
              s.setOnKeyTyped(new EventHandler<KeyEvent>() {
                  public void handle(KeyEvent e) {
                      if ("w".equals(e.getCharacter()) && e.isShortcutDown()) {
                          stage.hide();
                      }
                  }
              });
              stage.setScene(s);
              stage.show();
          }

          public static void main(String[] args) {launch(args);}
      }

            Assignee:
            Petr Pchelko (Inactive)
            Reporter:
            Nick D'Arcy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: