Пример #1
0
void BaseExecutionContext::onShutdownPostSend() {
  ServerStats::SetThreadMode(ServerStats::PostProcessing);
  try {
    try {
      ServerStatsHelper ssh("psp", ServerStatsHelper::TRACK_HWINST);
      if (!m_shutdowns.isNull()) {
        if (m_shutdowns.exists(PostSend)) {
          executeFunctions(m_shutdowns[PostSend]);
          m_shutdowns.remove(PostSend);
        }
        if (m_shutdowns.exists(CleanUp)) {
          executeFunctions(m_shutdowns[CleanUp]);
          m_shutdowns.remove(CleanUp);
        }
      }
    } catch (const ExitException &e) {
      // do nothing
    } catch (const Exception &e) {
      onFatalError(e);
    } catch (const Object &e) {
      onUnhandledException(e);
    }
  } catch (...) {
    Logger::Error("unknown exception was thrown from psp");
  }
  ServerStats::SetThreadMode(ServerStats::Idling);
}
void PlayerQuickItem::onSynchronize()
{
  if (!m_renderer && m_mpv)
  {
    m_renderer = new PlayerRenderer(m_mpv, window());
    if (!m_renderer->init())
    {
      delete m_renderer;
      m_renderer = NULL;
      emit onFatalError(tr("Could not initialize OpenGL."));
      return;
    }
    connect(window(), &QQuickWindow::beforeRendering, m_renderer, &PlayerRenderer::render, Qt::DirectConnection);
    connect(window(), &QQuickWindow::frameSwapped, m_renderer, &PlayerRenderer::swap, Qt::DirectConnection);
    window()->setPersistentOpenGLContext(true);
    window()->setPersistentSceneGraph(true);
    window()->setClearBeforeRendering(false);
    m_debugInfo = "";
    QOpenGLContext* glctx = QOpenGLContext::currentContext();
    if (glctx && glctx->isValid())
    {
      m_debugInfo += "\nOpenGL:\n";
      int syms[4] = {GL_VENDOR, GL_RENDERER, GL_VERSION, GL_SHADING_LANGUAGE_VERSION};
      for (auto sym : syms)
      {
        auto s = (char *)glctx->functions()->glGetString(sym);
        if (s)
          m_debugInfo += QString("  ") + QString::fromUtf8(s) + "\n";
      }
      m_debugInfo += "\n";
    }
  }
  if (m_renderer)
    m_renderer->m_size = window()->size() * window()->devicePixelRatio();
}
Пример #3
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
	m_pLhaLib(nullptr),
	m_pCurrentCodec(nullptr),
	m_szCurrentCodec(),
	m_szBaseTitle(),
	m_szCurrentArchive(),
	m_PathToItem()
{
    ui->setupUi(this);
	m_szBaseTitle = windowTitle();
	connect(this, SIGNAL(FileSelection(QString)), this, SLOT(onFileSelected(QString)));
	
	m_pCurrentCodec = QTextCodec::codecForLocale();
	m_szCurrentCodec = QString(m_pCurrentCodec->name());
	
	m_pLhaLib = new QLhALib(this);
	connect(m_pLhaLib, SIGNAL(message(QString)), this, SLOT(onMessage(QString)));
	connect(m_pLhaLib, SIGNAL(warning(QString)), this, SLOT(onWarning(QString)));
	connect(m_pLhaLib, SIGNAL(fatal_error(QString)), this, SLOT(onFatalError(QString)));
	
	QStringList treeHeaders;
	treeHeaders << "Name" 
			<< "Unpacked size" 
			<< "Packed size" 
			<< "Time" 
			<< "Date" 
			<< "Pack Mode" 
			<< "Comment"
			<< "User"
			<< "Group"
			<< "UID"
			<< "GID"
			//<< "Attributes"
			<< "CRC (F)" 
			//<< "CRC (H)" 
			<< "HLev"
			<< "OST";
	ui->treeWidget->setColumnCount(treeHeaders.size());
	ui->treeWidget->setHeaderLabels(treeHeaders);
	
	// if file given in command line
	QStringList vCmdLine = QApplication::arguments();
	if (vCmdLine.size() > 1)
	{
		emit FileSelection(vCmdLine[1]);
	}
}
Пример #4
0
void onCheckJVMTIError(jvmtiError errorCode, char* functionName)
{
	if (errorCode != JVMTI_ERROR_NONE)
	{
		jvmtiError curErr;
		char* agentErrMsg;
		curErr = (*local_jvmti_env)->GetErrorName(local_jvmti_env, errorCode, &agentErrMsg);
		char* newErrorMsg = createString(strlen(agentErrMsg) + strlen(functionName) + 2 + 50);

		if (curErr != JVMTI_ERROR_NONE)
			sprintf(newErrorMsg, "Error %s. Unable to fetch error details", functionName);
		else
			sprintf(newErrorMsg, "Error encountered %s. Error Reference: %s", functionName, agentErrMsg);

		onFatalError(newErrorMsg);
	}
}
Пример #5
0
void chDbgPanic3(const char *msg, const char * file, int line) {
	onFatalError(msg, file, line);
}