What Violation? 1
What bug does this code have?
// Thread 1
if (ptr != nullptr) {
ptr->process();
}
// Thread 2
delete ptr;
ptr = nullptr;
Sign in to answer questions and track your progress
Sign InWhat bug does this code have?
// Thread 1
if (ptr != nullptr) {
ptr->process();
}
// Thread 2
delete ptr;
ptr = nullptr;
Sign in to answer questions and track your progress
Sign In