mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed crash in GxsIdDetails::process (GxsIdDetails::mInstance == NULL) by adding one global instance of GxsIdDetails.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8149 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a9ba944e27
commit
a0631e3991
2
TODO.txt
2
TODO.txt
@ -23,7 +23,7 @@ E [X] it's not possible to create a Forum thread without a Owner.
|
|||||||
[X] the tooltip over GXS ids should show the avatar on the left side.
|
[X] the tooltip over GXS ids should show the avatar on the left side.
|
||||||
[X] fix data race between GXS ID default icons
|
[X] fix data race between GXS ID default icons
|
||||||
[X] Share of key shows "Not implemented". Since forums are public, share key should be hidden.
|
[X] Share of key shows "Not implemented". Since forums are public, share key should be hidden.
|
||||||
[ ] switching between forums might cause a crash. Seems to be due to GxsIdDetails::instance not always initialised when used.
|
[X] switching between forums might cause a crash. Seems to be due to GxsIdDetails::instance not always initialised when used.
|
||||||
|
|
||||||
GUI General
|
GUI General
|
||||||
E [ ] do we keep "Getting Started" ? the look needs to be improved. Any help doing this is welcome!
|
E [ ] do we keep "Getting Started" ? the look needs to be improved. Any help doing this is welcome!
|
||||||
|
@ -73,6 +73,25 @@ GxsIdDetails::~GxsIdDetails()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsIdDetails::initialize()
|
||||||
|
{
|
||||||
|
if (mInstance) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mInstance = new GxsIdDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GxsIdDetails::cleanup()
|
||||||
|
{
|
||||||
|
if (!mInstance) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete(mInstance);
|
||||||
|
mInstance = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void GxsIdDetails::objectDestroyed(QObject *object)
|
void GxsIdDetails::objectDestroyed(QObject *object)
|
||||||
{
|
{
|
||||||
if (!object) {
|
if (!object) {
|
||||||
@ -167,8 +186,6 @@ void GxsIdDetails::timerEvent(QTimerEvent *event)
|
|||||||
|
|
||||||
if (mPendingData.empty()) {
|
if (mPendingData.empty()) {
|
||||||
/* All done */
|
/* All done */
|
||||||
mInstance = NULL;
|
|
||||||
deleteLater();
|
|
||||||
} else {
|
} else {
|
||||||
/* Start timer */
|
/* Start timer */
|
||||||
doStartTimer();
|
doStartTimer();
|
||||||
@ -216,9 +233,11 @@ bool GxsIdDetails::process(const RsGxsId &id, GxsIdDetailsCallbackFunction callb
|
|||||||
|
|
||||||
/* Add id to the pending list */
|
/* Add id to the pending list */
|
||||||
if (!mInstance) {
|
if (!mInstance) {
|
||||||
mInstance = new GxsIdDetails;
|
/* GxsIdDetails not initialized. Please use ::initialize */
|
||||||
mInstance->moveToThread(qApp->thread());
|
callback(GXS_ID_DETAILS_TYPE_FAILED, details, object, data);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(GXS_ID_DETAILS_TYPE_LOADING, details, object, data);
|
callback(GXS_ID_DETAILS_TYPE_LOADING, details, object, data);
|
||||||
|
|
||||||
CallbackData pendingData;
|
CallbackData pendingData;
|
||||||
|
@ -57,6 +57,9 @@ public:
|
|||||||
GxsIdDetails();
|
GxsIdDetails();
|
||||||
virtual ~GxsIdDetails();
|
virtual ~GxsIdDetails();
|
||||||
|
|
||||||
|
static void initialize();
|
||||||
|
static void cleanup();
|
||||||
|
|
||||||
/* Information */
|
/* Information */
|
||||||
static bool MakeIdDesc(const RsGxsId &id, bool doIcons, QString &desc, QList<QIcon> &icons, QString& comment);
|
static bool MakeIdDesc(const RsGxsId &id, bool doIcons, QString &desc, QList<QIcon> &icons, QString& comment);
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include <retroshare/rsversion.h>
|
#include <retroshare/rsversion.h>
|
||||||
#include <lang/languagesupport.h>
|
#include <lang/languagesupport.h>
|
||||||
#include "gui/settings/rsharesettings.h"
|
#include "gui/settings/rsharesettings.h"
|
||||||
|
#include "gui/gxs/GxsIdDetails.h"
|
||||||
|
|
||||||
#include "rshare.h"
|
#include "rshare.h"
|
||||||
|
|
||||||
@ -160,12 +161,16 @@ Rshare::Rshare(QStringList args, int &argc, char **argv, const QString &dir)
|
|||||||
|
|
||||||
/* Switch off auto shutdown */
|
/* Switch off auto shutdown */
|
||||||
setQuitOnLastWindowClosed ( false );
|
setQuitOnLastWindowClosed ( false );
|
||||||
|
|
||||||
|
/* Initialize GxsIdDetails */
|
||||||
|
GxsIdDetails::initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
Rshare::~Rshare()
|
Rshare::~Rshare()
|
||||||
{
|
{
|
||||||
|
/* Cleanup GxsIdDetails */
|
||||||
|
GxsIdDetails::cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Rshare::retroshareVersion(bool withRevision)
|
QString Rshare::retroshareVersion(bool withRevision)
|
||||||
|
Loading…
Reference in New Issue
Block a user