Commit 21bcb29c by NitefullWind

1. 初始化d指针。 析构弹出的支付窗口。

parent ccf44348
......@@ -5,7 +5,7 @@ class ctkPluginContext;
FMPePay::FMPePay(ctkPluginContext *context)
: FMPePayInterface(context),
_inited(false),
d_ptr(new FMPePayPrivate)
d_ptr(new FMPePayPrivate(this))
{
FMPStartEventHandler *ste_handler = new FMPStartEventHandler(_ctx, this);
}
......
......@@ -9,20 +9,23 @@
#include "Dialog.h"
#include "qfmclient.h"
FMPePayPrivate::FMPePayPrivate(QObject *parent)
: QObject(parent),
FMPePayPrivate::FMPePayPrivate(FMPePay *parent)
: q_ptr(parent),
_fmClient(nullptr),
_payDialog(nullptr)
{
}
//FMPePayPrivate::~FMPePayPrivate()
//{
// if(_payDialog != nullptr) {
// delete _payDialog;
// }
//}
FMPePayPrivate::~FMPePayPrivate()
{
if(_payDialog != nullptr) {
delete _payDialog;
}
if(_fmClient != nullptr) {
delete _fmClient;
}
}
//int FMPePayPrivate::StartService()
//{
......@@ -55,10 +58,6 @@ void FMPePayPrivate::onShowPayWnd()
_fmClient = new QFmClient();
_fmClient->start();
_payDialog = new Dialog();
_payDialog->show();
} else {
delete _payDialog;
_payDialog = new Dialog();
_payDialog->show();
}
_payDialog->show();
}
......@@ -12,8 +12,8 @@ class FMPePayPrivate : public QObject
Q_OBJECT
Q_DECLARE_PUBLIC(FMPePay)
public:
explicit FMPePayPrivate(QObject* parent=0);
// ~FMPePayPrivate();
explicit FMPePayPrivate(FMPePay* parent);
~FMPePayPrivate();
// int StartService();
int StopService();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment