Fixes critical memory leak (#195)
This commit is contained in:
parent
8045f5689f
commit
68c910d107
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user