This method is called when the application is closing. This is either by
the exit menuItem or by clicking on the window's system menu.
426359
void callOnClose() {
        if (projectChanged && !SystemProperties.getBoolean("findbugs.skipSaveChangesWarning")) {
            Object[] options = {
                    L10N.getLocalString("dlg.save_btn", "Save"),
                    L10N.getLocalString("dlg.dontsave_btn", "Don't Save"),
                    L10N.getLocalString("dlg.cancel_btn", "Cancel"),
            };
            int value = JOptionPane.showOptionDialog(this, getActionWithoutSavingMsg("closing"),
                    L10N.getLocalString("msg.confirm_save_txt", "Do you want to save?"),
                    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);

            if (value == 2 || value == JOptionPane.CLOSED_OPTION) {
                return;
            } else if (value == 0) {

                if (saveFile == null) {
                    if (!mainFrameLoadSaveHelper.saveAs()) {
                        return;
                    }
                } else {
                    mainFrameLoadSaveHelper.save();
                }
            }
        }

        GUISaveState guiSaveState = GUISaveState.getInstance();
        guiLayout.saveState();
        guiSaveState.setFrameBounds(getBounds());
        guiSaveState.setExtendedWindowState(getExtendedState());
        guiSaveState.save();
        System.exit(0);
    }
852930
def close(self):
        ''''''
        self.time_to_quit = True
        self.close_window.release()
        if self.child.is_alive():
            self.child.join(1)

        self.child.terminate()

        self.mavlink_message_queue_handler.join()

        self.event_queue_lock.acquire()
        self.event_queue.put(MissionEditorEvent(me_event.MEE_TIME_TO_QUIT));
        self.event_queue_lock.release()
774728
def close(self):
        
        self.application.client_leaving(self)

        self.conn.close()
        self.closed = True
14910
public void close() {
        if (animation != null) {
            animation.setRate(-1);
            animation.play();
            animation.setOnFinished(e -> {
                closeDialog();
            });
        } else {
            setOpacity(0);
            setVisible(false);
            closeDialog();
        }

    }
400256
public void exiting () {
		StackTraceElement caller = StackTraceUtils.getCallerStackTraceElement ();
		logger.exiting (caller.getClassName (), caller.getMethodName ());
	}
613017
public void windowClosing(WindowEvent e)
    {
        if (m_dialog.getContentPane().getComponentCount() > 0)
            if (m_dialog.getContentPane().getComponent(0) instanceof BaseApplet)
                ((BaseApplet)m_dialog.getContentPane().getComponent(0)).free();
        m_dialog.dispose();     // Remove dialog.
    }
393283
void close() {
        if (this.project != null) {
            Util.logger().log(Level.FINE, "Closing Protege project {0}",
                    this.projectIdentifier);

            for (Iterator<ProjectListener> itr =
                         this.projectListeners.iterator(); itr.hasNext(); ) {
                this.project.removeProjectListener(itr.next());
                itr.remove();
            }
            try {
                this.project.dispose();
                Util.logger().fine("Done closing connection.");
            } catch (IllegalStateException e) {
                /*
                 * Protege registers a shutdown hook that is removed when
                 * dispose() is called on a project. However, we might call this
                 * method during an already started shutdown process. See
                 * documentation for java.lang.Runtime.removeShutdownHook. This
                 * exception should be harmless, unless there are other reasons
                 * dispose() could throw this exception?
                 */
                Util.logger().fine("Done closing connection.");
            } finally {
                this.project = null;
            }

        }
    }
679267
def do_exit(self, arg):
        """"""

        if self.current:
            self.current.close()
        self.resource_manager.close()
        del self.resource_manager
        return True
1084748
public final void close()
    {
        try
        {
            if (!isClosed)
            {
                isRunning = false;
                isClosed = true;
                agent.onClose();
            }
        }
        catch (final Throwable throwable)
        {
            errorHandler.onError(throwable);
        }
    }
680061
def on_quit(self, event, wind=None):
        
        if wind:
            wind.Destroy()
        if not self.parent.IsShown():
            self.on_show_mainframe(None)
            # re-do the quit binding
            self.parent.Bind(wx.EVT_MENU, self.on_quit, self.file_quit)
        else:
            self.parent.Close()
563413
protected void close() {

        m_popup.hideDelayed();
        m_selectionInput.m_textbox.setFocus(true);
        m_selectionInput.m_textbox.setCursorPos(m_selectionInput.m_textbox.getText().length());
    }
1272532
def do_close(self, args):
        """"""

        if not self.current:
            print('There are no resources in use. Use the command "open".')
            return

        try:
            self.current.close()
        except Exception as e:
            print(e)
        else:
            print('The resource has been closed.')
            self.current = None
            self.prompt = self.default_prompt
618701
protected boolean onItemClicked() {

        if (isEnabled()) {
            m_overlay.closeSubMenus();

            if (hasSubMenu()) {
                openSubMenu();
                return false;
            } else {
                if (m_rootComponent.isHideAutomatically()) {
                    closeContextMenu();
                    return true;
                }
                return false;
            }
        }

        return false;
    }
159308
synchronized void close() {
    if (this.remoteManager.isPresent()) {
      try {
        this.remoteManager.get().close();
      } catch (final Exception e) {
        LOG.log(Level.WARNING, "Exception while shutting down the RemoteManager.", e);
      }
    }
  }
308157
public void exit() {

        if (m_exitCalled) {
            return;
        }
        m_exitCalled = true;
        try {
            if (m_additionalShellCommands != null) {
                m_additionalShellCommands.shellExit();
            } else if (null != m_shellCommands) {
                m_shellCommands.shellExit();
            }
        } catch (Throwable t) {
            t.printStackTrace();
        }
        if (m_opencms != null) {
            // if called by an in line script we don't want to kill the whole instance
            try {
                m_opencms.shutDown();
            } catch (Throwable t) {
                t.printStackTrace();
            }
        }
    }
1211258
def close(self):
        ''''''
        self.close_window.set()
        if self.child.is_alive():
            self.child.join(1)

        self.child.terminate()

        self.event_queue_lock.acquire()
        self.event_queue.put(MissionEditorEvent(me_event.MEE_TIME_TO_QUIT));
        self.event_queue_lock.release()
1261682
private void doClose()
	{
		// set visible, if system tray active and frame is iconified
		if (useSystemTray && (getExtendedState()&ICONIFIED)!=0) setVisible(true);
		
		doStopPlaying();
		getSeekBarPanel().pauseThread();
		getVULMeterPanel().pauseThread();
		getVURMeterPanel().pauseThread();
		getSALMeterPanel().pauseThread();
		getSARMeterPanel().pauseThread();
		getLEDScrollPanel().pauseThread();
		writePropertyFile();
		if (audioProcessor!=null) audioProcessor.removeListener(this);
		
		MultimediaContainerManager.removeMultimediaContainerEventListener(this);

		useSystemTray = false; setSystemTray();

		for (Window win : windows)
		{
			win.setVisible(false);
			win.dispose();
		}
		setVisible(false);
		dispose();
		
		System.exit(0); // this should not be needed! 
	}