Skip to content

Commit 4189039

Browse files
committed
Fixed unnecessary null pointer check.
Signed-off-by: Lucas Baraya <[email protected]>
1 parent eb2a830 commit 4189039

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

openvdb_cmd/vdb_view/Viewer.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@ init(const std::string& progName, bool background)
189189
if (background) {
190190
if (sThreadMgr == nullptr) {
191191
std::lock_guard<std::mutex> lock(sLock);
192-
OPENVDB_START_THREADSAFE_STATIC_WRITE
193-
sThreadMgr = new ThreadManager;
194-
OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
192+
if (sThreadMgr == nullptr) {
193+
OPENVDB_START_THREADSAFE_STATIC_WRITE
194+
sThreadMgr = new ThreadManager;
195+
OPENVDB_FINISH_THREADSAFE_STATIC_WRITE
196+
}
195197
}
196198
} else {
197199
if (sThreadMgr != nullptr) {

0 commit comments

Comments
 (0)