fix: PVS-Studio V508 mark false
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
7c8f04aa75
commit
4efa574eec
@ -48,7 +48,7 @@ public:
|
|||||||
if (callOnStart) {
|
if (callOnStart) {
|
||||||
callback(value);
|
callback(value);
|
||||||
}
|
}
|
||||||
return std::shared_ptr<int>(new int(id), [this](int* id) {
|
return std::shared_ptr<int>(new int(id), [this](int* id) { //-V508
|
||||||
observers.erase(*id);
|
observers.erase(*id);
|
||||||
delete id;
|
delete id;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -95,7 +95,7 @@ glshader compile_shader(GLenum type, const GLchar* source, const std::string& fi
|
|||||||
"vertex shader compilation failed ("+file+"):\n"+std::string(infoLog)
|
"vertex shader compilation failed ("+file+"):\n"+std::string(infoLog)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return glshader(new GLuint(shader), shader_deleter);
|
return glshader(new GLuint(shader), shader_deleter); //-V508
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<Shader> Shader::create(
|
std::unique_ptr<Shader> Shader::create(
|
||||||
|
|||||||
@ -74,7 +74,7 @@ void scripting::initialize(Engine* engine) {
|
|||||||
lua::pushstring(L, pack.id);
|
lua::pushstring(L, pack.id);
|
||||||
lua::setfield(L, "PACK_ID");
|
lua::setfield(L, "PACK_ID");
|
||||||
lua::pop(L);
|
lua::pop(L);
|
||||||
return std::shared_ptr<int>(new int(id), [=](int* id) {
|
return std::shared_ptr<int>(new int(id), [=](int* id) { //-V508
|
||||||
lua::removeEnvironment(L, *id);
|
lua::removeEnvironment(L, *id);
|
||||||
delete id;
|
delete id;
|
||||||
});
|
});
|
||||||
@ -101,7 +101,7 @@ void scripting::initialize(Engine* engine) {
|
|||||||
lua::pop(L);
|
lua::pop(L);
|
||||||
}
|
}
|
||||||
lua::pop(L);
|
lua::pop(L);
|
||||||
return std::shared_ptr<int>(new int(id), [=](int* id) {
|
return std::shared_ptr<int>(new int(id), [=](int* id) { //-V508
|
||||||
lua::removeEnvironment(L, *id);
|
lua::removeEnvironment(L, *id);
|
||||||
delete id;
|
delete id;
|
||||||
});
|
});
|
||||||
@ -131,7 +131,7 @@ void scripting::initialize(Engine* engine) {
|
|||||||
}
|
}
|
||||||
lua::pop(L);
|
lua::pop(L);
|
||||||
|
|
||||||
return std::shared_ptr<int>(new int(id), [=](int* id) {
|
return std::shared_ptr<int>(new int(id), [=](int* id) { //-V508
|
||||||
lua::removeEnvironment(L, *id);
|
lua::removeEnvironment(L, *id);
|
||||||
delete id;
|
delete id;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -16,7 +16,7 @@ namespace util {
|
|||||||
observer_handler add(runnable callback) {
|
observer_handler add(runnable callback) {
|
||||||
int id = nextid++;
|
int id = nextid++;
|
||||||
runnables[id] = std::move(callback);
|
runnables[id] = std::move(callback);
|
||||||
return observer_handler(new int(id), [this](int* id) {
|
return observer_handler(new int(id), [this](int* id) { //-V508
|
||||||
runnables.erase(*id);
|
runnables.erase(*id);
|
||||||
delete id;
|
delete id;
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user