Skip to content

Commit

Permalink
Merge branch 'rc2.2.0' into rc2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
planetchili committed Oct 1, 2024
2 parents 140080d + 7b20d31 commit 535b003
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion IntelPresentMon/CommonUtilities/log/ChannelFlusher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ namespace pmon::util::log
}
ChannelFlusher::~ChannelFlusher()
{
exitEvent_.Set();
pmquell(exitEvent_.Set());
}
}
6 changes: 6 additions & 0 deletions IntelPresentMon/CommonUtilities/log/ChannelFlusher.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ namespace pmon::util::log
public:
ChannelFlusher(std::weak_ptr<IEntrySink> pChan);
~ChannelFlusher();

ChannelFlusher(const ChannelFlusher&) = delete;
ChannelFlusher & operator=(const ChannelFlusher&) = delete;
ChannelFlusher(ChannelFlusher&&) = delete;
ChannelFlusher & operator=(ChannelFlusher&&) = delete;

private:
std::weak_ptr<IEntrySink> pChan_;
mt::Thread worker_;
Expand Down
7 changes: 7 additions & 0 deletions IntelPresentMon/PresentMonService/Service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ void Service::SignalClientSessionOpened()
SetEvent(clientSessionEvent_);
}

Service::~Service()
{
if (clientSessionEvent_) {
CloseHandle(clientSessionEvent_);
}
}

ConcreteService::ConcreteService(const TCHAR* serviceName) : mServiceName(serviceName)
{
mEventLogHandle = RegisterEventSource(NULL, mServiceName.c_str());
Expand Down
2 changes: 1 addition & 1 deletion IntelPresentMon/PresentMonService/Service.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Service
virtual HANDLE GetResetPowerTelemetryHandle() = 0;
HANDLE GetClientSessionHandle();
void SignalClientSessionOpened();
virtual ~Service() = default;
virtual ~Service();
private:
std::optional<int> errCode_;
HANDLE clientSessionEvent_;
Expand Down
7 changes: 7 additions & 0 deletions PresentData/PresentMonTraceConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ PMTraceConsumer::PMTraceConsumer()
hEventsReadyEvent = CreateEventW(nullptr, FALSE, FALSE, nullptr);
}

PMTraceConsumer::~PMTraceConsumer()
{
if (hEventsReadyEvent && hEventsReadyEvent != INVALID_HANDLE_VALUE) {
CloseHandle(hEventsReadyEvent);
}
}

void PMTraceConsumer::HandleD3D9Event(EVENT_RECORD* pEventRecord)
{
auto const& hdr = pEventRecord->EventHeader;
Expand Down
6 changes: 6 additions & 0 deletions PresentData/PresentMonTraceConsumer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ struct PMTraceConsumer
// Functions for decoding ETW and analysing process and present events.

PMTraceConsumer();
~PMTraceConsumer();

PMTraceConsumer(const PMTraceConsumer&) = delete;
PMTraceConsumer& operator=(const PMTraceConsumer&) = delete;
PMTraceConsumer(PMTraceConsumer&&) = delete;
PMTraceConsumer& operator=(PMTraceConsumer&&) = delete;

void HandleDxgkBlt(EVENT_HEADER const& hdr, uint64_t hwnd, bool redirectedPresent);
void HandleDxgkFlip(EVENT_HEADER const& hdr, int32_t flipInterval, bool isMMIOFlip, bool isMPOFlip);
Expand Down

0 comments on commit 535b003

Please sign in to comment.