Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8127942

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8
    • fx2.1
    • javafx
    • OSX JDK 7 update 4. Using JavaFX 2.1 that shipped with it.

    Description

      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);}
      }

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported: