mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-30 20:36:36 -05:00
experimental fix against early closing crash on CreateCircleDialog
This commit is contained in:
parent
04fd7f17ca
commit
5f15414e65
2 changed files with 32 additions and 4 deletions
|
|
@ -51,7 +51,10 @@
|
|||
CreateCircleDialog::CreateCircleDialog()
|
||||
: QDialog(NULL, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
mIdentitiesLoading = false;
|
||||
mCloseAfterIdentitiesLoaded = false;
|
||||
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
|
||||
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||
|
|
@ -112,11 +115,22 @@ CreateCircleDialog::CreateCircleDialog()
|
|||
QObject::connect(ui.radioButton_Public, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||
QObject::connect(ui.radioButton_Self, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||
QObject::connect(ui.radioButton_Restricted, SIGNAL(toggled(bool)), this, SLOT(updateCircleType(bool))) ;
|
||||
|
||||
}
|
||||
|
||||
CreateCircleDialog::~CreateCircleDialog()
|
||||
{
|
||||
}
|
||||
void CreateCircleDialog::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
if(mIdentitiesLoading)
|
||||
{
|
||||
mCloseAfterIdentitiesLoaded = true;
|
||||
return;
|
||||
}
|
||||
else
|
||||
QDialog::closeEvent(e);
|
||||
}
|
||||
|
||||
void CreateCircleDialog::editExistingId(const RsGxsGroupId &circleId, const bool &clearList /*= true*/,bool readonly)
|
||||
{
|
||||
|
|
@ -700,6 +714,8 @@ void CreateCircleDialog::loadIdentities()
|
|||
{
|
||||
std::cerr << "Loading identities..." << std::endl;
|
||||
|
||||
mIdentitiesLoading = true;
|
||||
|
||||
RsThread::async([this]()
|
||||
{
|
||||
std::list<RsGroupMetaData> ids_meta;
|
||||
|
|
@ -735,7 +751,13 @@ void CreateCircleDialog::loadIdentities()
|
|||
fillIdentitiesList(*id_groups);
|
||||
|
||||
delete id_groups;
|
||||
}, this );
|
||||
|
||||
mIdentitiesLoading = false;
|
||||
|
||||
if(mCloseAfterIdentitiesLoaded)
|
||||
close();
|
||||
|
||||
}, this );
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue