Commit 21bcb29c by NitefullWind

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

parent ccf44348
...@@ -5,7 +5,7 @@ class ctkPluginContext; ...@@ -5,7 +5,7 @@ class ctkPluginContext;
FMPePay::FMPePay(ctkPluginContext *context) FMPePay::FMPePay(ctkPluginContext *context)
: FMPePayInterface(context), : FMPePayInterface(context),
_inited(false), _inited(false),
d_ptr(new FMPePayPrivate) d_ptr(new FMPePayPrivate(this))
{ {
FMPStartEventHandler *ste_handler = new FMPStartEventHandler(_ctx, this); FMPStartEventHandler *ste_handler = new FMPStartEventHandler(_ctx, this);
} }
......
...@@ -9,20 +9,23 @@ ...@@ -9,20 +9,23 @@
#include "Dialog.h" #include "Dialog.h"
#include "qfmclient.h" #include "qfmclient.h"
FMPePayPrivate::FMPePayPrivate(QObject *parent) FMPePayPrivate::FMPePayPrivate(FMPePay *parent)
: QObject(parent), : q_ptr(parent),
_fmClient(nullptr), _fmClient(nullptr),
_payDialog(nullptr) _payDialog(nullptr)
{ {
} }
//FMPePayPrivate::~FMPePayPrivate() FMPePayPrivate::~FMPePayPrivate()
//{ {
// if(_payDialog != nullptr) { if(_payDialog != nullptr) {
// delete _payDialog; delete _payDialog;
// } }
//} if(_fmClient != nullptr) {
delete _fmClient;
}
}
//int FMPePayPrivate::StartService() //int FMPePayPrivate::StartService()
//{ //{
...@@ -55,10 +58,6 @@ void FMPePayPrivate::onShowPayWnd() ...@@ -55,10 +58,6 @@ void FMPePayPrivate::onShowPayWnd()
_fmClient = new QFmClient(); _fmClient = new QFmClient();
_fmClient->start(); _fmClient->start();
_payDialog = new Dialog(); _payDialog = new Dialog();
_payDialog->show();
} else {
delete _payDialog;
_payDialog = new Dialog();
_payDialog->show();
} }
_payDialog->show();
} }
...@@ -12,8 +12,8 @@ class FMPePayPrivate : public QObject ...@@ -12,8 +12,8 @@ class FMPePayPrivate : public QObject
Q_OBJECT Q_OBJECT
Q_DECLARE_PUBLIC(FMPePay) Q_DECLARE_PUBLIC(FMPePay)
public: public:
explicit FMPePayPrivate(QObject* parent=0); explicit FMPePayPrivate(FMPePay* parent);
// ~FMPePayPrivate(); ~FMPePayPrivate();
// int StartService(); // int StartService();
int StopService(); 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