Fixes critical memory leak (#195)

This commit is contained in:
Atul R 2019-11-12 00:43:45 +01:00 committed by GitHub
parent 8045f5689f
commit 68c910d107
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,8 +18,8 @@ bool isNapiValueInt(Napi::Env& env, Napi::Value& num);
std::string getNapiObjectClassName(Napi::Object& object);
template <typename T>
void safeDelete(QPointer<T> component) {
if (component.isNull()) {
void safeDelete(QPointer<T>& component) {
if (!component.isNull()) {
delete component;
}
}