Project

General

Profile

0002-Catch-recursion-in-message-logger.patch

patch to prevent a segfault on exit - jesperht, 03/13/2009 11:44 PM

View differences:

src/client/client.cpp
50 50

  
51 51
/*** Initialization/destruction ***/
52 52

  
53
bool Client::instanceExists()
54
{
55
  return instanceptr;
56
}
57

  
53 58
Client *Client::instance() {
54 59
  if(!instanceptr)
55 60
    instanceptr = new Client();
......
467 472
    Quassel::logFatalMessage(msg);
468 473
  } else {
469 474
    QString msgString = QString("%1\n").arg(msg);
475

  
476
    //Check to see if there is an instance around, else we risk recursions
477
    //when calling instance() and creating new ones.
478
    if (!instanceExists())
479
      return;
480

  
470 481
    instance()->_debugLog << msgString;
471 482
    emit instance()->logUpdated(msgString);
472 483
  }
src/client/client.h
61 61
    RemoteCore
62 62
  };
63 63

  
64
  static bool instanceExists();
64 65
  static Client *instance();
65 66
  static void destroy();
66 67
  static void init(AbstractUi *);
67
-