mirror of
https://github.com/openharmony/window_window_manager.git
synced 2026-08-24 15:55:05 -04:00
修复并发赋值liveCreaseRegion_导致的内存风险
Signed-off-by: peixu <peixu1@huawei.com>
This commit is contained in:
+1
@@ -96,6 +96,7 @@ private:
|
||||
FoldCreaseRegion GetFoldCreaseRegion(bool isVertical, bool isNeedReverse) const;
|
||||
void GetFoldCreaseRect(bool isVertical, bool isNeedReverse, const std::vector<int32_t>& foldRect,
|
||||
std::vector<DMRect>& foldCreaseRect) const;
|
||||
mutable std::mutex liveCreaseRegionMutex_;
|
||||
std::mutex superStatusMutex_;
|
||||
std::vector<SuperFoldCreaseRegionItem> superFoldCreaseRegionItems_;
|
||||
|
||||
|
||||
+1
@@ -515,6 +515,7 @@ sptr<FoldCreaseRegion> SuperFoldStateManager::GetCurrentFoldCreaseRegion()
|
||||
FoldCreaseRegion SuperFoldStateManager::GetLiveCreaseRegion()
|
||||
{
|
||||
TLOGI(WmsLogTag::DMS, "enter");
|
||||
std::lock_guard<std::mutex> lock_mode(liveCreaseRegionMutex_);
|
||||
SuperFoldStatus curFoldState = ScreenSessionManager::GetInstance().GetSuperFoldStatus();
|
||||
if (curFoldState == SuperFoldStatus::UNKNOWN || curFoldState == SuperFoldStatus::FOLDED) {
|
||||
return FoldCreaseRegion(0, {});
|
||||
|
||||
Reference in New Issue
Block a user