Sync the database, wrap up the game, and halt.
169898
def on_stop(self, *largs):
        """"""
        self.strings.save()
        self.funcs.save()
        self.engine.commit()
        self.procman.shutdown()
        self.config.write()
1200459
@SuppressWarnings("WeakerAccess")
    public synchronized void stop() {
        if (isRunning()) {
            running.set(false);
            MetadataFinder.getInstance().removeMetadataProvider(metadataProvider);
            for (Database database : databases.values()) {
                //noinspection ResultOfMethodCallIgnored
                database.sourceFile.delete();
            }
            databases.clear();
        }
    }
1158042
public void stop() {
		hits = 0;
		misses = 0;
		unavailable = 0;
		delayedHits = 0;
		delayedMisses = 0;
		data.clear();
		mirror.clear();
		isStarted = false;
	}
847093
async def terminate(self) -> None:
        """"""
        await asyncio.sleep(config.shutdown_wait)
        # stop server and close loop if no more connection exists
        if not is_connected():
            stop_server(self.application.server)
            self.application.loop.stop()
442570
async def close(self) -> None:
        """"""
        await self._execute(self._conn.close)
        self._running = False
        self._connection = None
676068
def stop(self):
        """"""
        if ZMQ:
            logging.warning(self.master.stop())
            z.context.term()
        self.db.close()
708322
def close(self):
        

        if self.__delayed_connection_path and self.__connection is None:
            self.__initialize_connection()
            return

        try:
            self.check_connection()
        except (SystemError, NullDatabaseConnectionError):
            return

        logger.debug("close connection to a SQLite database: path='{}'".format(self.database_path))

        self.commit()
        self.connection.close()
        self.__initialize_connection()
1206507
public void stop() {
		if (!PlatformUI.isWorkbenchRunning())
			return;
		final IWorkbench workbench = PlatformUI.getWorkbench();
		final Display display = workbench.getDisplay();
		display.syncExec(new Runnable() {
			public void run() {
				if (!display.isDisposed())
					workbench.close();
			}
		});
	}
1040066
def _Close(self):
    """"""
    if self._database_object:
      self._database_object.Close()

    self._blob = None
    self._current_offset = 0
    self._size = 0
    self._table_name = None
978571
def flushdb(self, async_op=False):
        
        if async_op:
            fut = self.execute(b'FLUSHDB', b'ASYNC')
        else:
            fut = self.execute(b'FLUSHDB')
        return wait_ok(fut)
911372
private void finish(boolean commit)
   {
      for (Synchronization s : syncs)
      {
         s.beforeCompletion();
      }

      if (commit)
      {
         status = Status.STATUS_COMMITTED;
      }
      else
      {
         status = Status.STATUS_ROLLEDBACK;
      }

      for (Synchronization s : syncs)
      {
         s.afterCompletion(status);
      }

      status = Status.STATUS_UNKNOWN;
      syncs.clear();
      resources.clear();
   }
1168218
void endTransaction(Session session) {

        try {
            writeLock.lock();

            long timestamp = session.transactionTimestamp;

            synchronized (liveTransactionTimestamps) {
                session.isTransaction = false;

                int index = liveTransactionTimestamps.indexOf(timestamp);

                liveTransactionTimestamps.remove(index);
            }

            mergeExpiredTransactions(session);
        } finally {
            writeLock.unlock();
        }
    }
449255
def finish():
    """"""
    out.warn("Interrupted!")
    for t in threads:
        t.stop()
    jobs.clear()
    out.warn("Waiting for download threads to finish.")
24784
public void stop() {

    reflector.stop();
    reflectorFuture.cancel(true);
    reflectExecutor.shutdown();

    if (resyncFuture != null) {
      resyncFuture.cancel(true);
      resyncExecutor.shutdown();
    }
  }
729494
def stop(self, wait=True):
        ''' 

        '''

        # TODO should probably close all connections and shut down all sessions here
        for context in self._applications.values():
            context.run_unload_hook()

        self._stats_job.stop()
        if self._mem_job is not None:
            self._mem_job.stop()
        self._cleanup_job.stop()
        if self._ping_job is not None:
            self._ping_job.stop()

        self._clients.clear()
1158777
def close(self):
        """"""
        if hasattr(self.db, 'close'):
            with self.write_mutex:
                self.db.close()
750220
def stop_sync(self):
        """"""

        if self.scanning:
            self.stop_scan()

        # Make a copy since this will change size as we disconnect
        con_copy = copy.copy(self._connections)

        for _, context in con_copy.items():
            self.disconnect_sync(context['connection_id'])

        self._command_task.stop()
        self._stream.stop()
        self._serial_port.close()

        self.stopped = True