flutter: c++: Replace NULL to nullptr

This commit is contained in:
Calcitem 2021-05-16 11:20:36 +08:00
parent b1ce6c61e8
commit 142e32b17d
2 changed files with 11 additions and 11 deletions

View File

@ -20,7 +20,7 @@
#include "command_queue.h"
#include "command_channel.h"
CommandChannel *CommandChannel::instance = NULL;
CommandChannel *CommandChannel::instance = nullptr;
CommandChannel::CommandChannel()
{
@ -30,7 +30,7 @@ CommandChannel::CommandChannel()
CommandChannel *CommandChannel::getInstance()
{
if (instance == NULL) {
if (instance == nullptr) {
instance = new CommandChannel();
}
@ -39,22 +39,22 @@ CommandChannel *CommandChannel::getInstance()
void CommandChannel::release()
{
if (instance != NULL) {
if (instance != nullptr) {
delete instance;
instance = NULL;
instance = nullptr;
}
}
CommandChannel::~CommandChannel()
{
if (commandQueue != NULL) {
if (commandQueue != nullptr) {
delete commandQueue;
commandQueue = NULL;
commandQueue = nullptr;
}
if (responseQueue != NULL) {
if (responseQueue != nullptr) {
delete responseQueue;
responseQueue = NULL;
responseQueue = nullptr;
}
}

View File

@ -31,7 +31,7 @@
#define pthread_t HANDLE
#define pthread_cancel(x) TerminateThread((x), 0)
#define pthread_exit(x) _endthread
#define pthread_join(x, NULL) WaitForSingleObject((x), INFINITE)
#define pthread_join(x, nullptr) WaitForSingleObject((x), INFINITE)
extern "C" {
@ -53,7 +53,7 @@ int MillEngine::startup()
{
if (thread_id) {
shutdown();
pthread_join(thread_id, NULL);
pthread_join(thread_id, nullptr);
}
CommandChannel::getInstance();
@ -107,7 +107,7 @@ int MillEngine::shutdown()
{
send("quit");
pthread_join(thread_id, NULL);
pthread_join(thread_id, nullptr);
thread_id = nullptr;