Unlocked a mutex after modifying the associated variable (#5625)

* Unlocked a mutex after modifying the variable the mutex was meant for.
This fixes an issue where mounting bundles in the Editor was causing the Editor to freeze up, because the following line, m_levelOpenEvent.Signal, resulted in another attempt to lock that same mutex.

Signed-off-by: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Added a comment describing why the unlock is necessary.

Signed-off-by: AMZN-stankowi <4838196+AMZN-stankowi@users.noreply.github.com>
monroegm-disable-blank-issue-2
AMZN-stankowi 4 years ago committed by GitHub
parent 5e04ddcc02
commit c3dacb1e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1241,6 +1241,10 @@ namespace AZ::IO
m_arrZips.insert(revItZip.base(), desc); m_arrZips.insert(revItZip.base(), desc);
// This lock is for m_arrZips.
// Unlock it now because the modification is complete, and events responding to this signal
// will attempt to lock the same mutex, causing the application to lock up.
lock.unlock();
m_levelOpenEvent.Signal(levelDirs); m_levelOpenEvent.Signal(levelDirs);
} }

Loading…
Cancel
Save