Skip to content

Commit

Permalink
释放winpty
Browse files Browse the repository at this point in the history
  • Loading branch information
heyuanjie87 committed Oct 19, 2018
1 parent 2ce2001 commit 7dfd71f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Console/pty.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "pty.h"
#include <QWinEventNotifier>

Pty* fffd = NULL;

Pty::Pty(QObject *parent) : QObject(parent)
{
wpty = NULL;
Expand All @@ -11,6 +9,11 @@ Pty::Pty(QObject *parent) : QObject(parent)
Qt::QueuedConnection);
}

Pty::~Pty()
{
winpty_free(wpty);
}

bool Pty::start(QString name, QString args = "")
{
std::wstring program, cmdline;
Expand Down
1 change: 1 addition & 0 deletions Console/pty.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Pty : public QObject

public:
explicit Pty(QObject *parent = 0);
~Pty();

bool start(QString name, QString args);
QByteArray readAll();
Expand Down

0 comments on commit 7dfd71f

Please sign in to comment.