qpulse: properly deref requested operation objects
This commit is contained in:
parent
ce5b1e52d3
commit
0cda1431ec
18
qpulse.cpp
18
qpulse.cpp
@ -27,18 +27,28 @@ pa_context_state_t QPulse::ConnectionState()
|
|||||||
return pa_context_get_state(c);
|
return pa_context_get_state(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QPulse::RequestServerInfo()
|
bool QPulse::RequestServerInfo()
|
||||||
{
|
{
|
||||||
//ThreadedMainLoopLock lock(ml);
|
//ThreadedMainLoopLock lock(ml);
|
||||||
|
|
||||||
pa_context_get_server_info(c, &QPulse::onGotServerInfoSt, this);
|
pa_operation* o = pa_context_get_server_info(c, &QPulse::onGotServerInfoSt, this);
|
||||||
|
if (! o) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pa_operation_unref(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QPulse::RequestCardInfo()
|
bool QPulse::RequestCardInfo()
|
||||||
{
|
{
|
||||||
//ThreadedMainLoopLock lock(ml);
|
//ThreadedMainLoopLock lock(ml);
|
||||||
|
|
||||||
pa_context_get_card_info_list(c, &QPulse::onGotCardInfoListSt, this);
|
pa_operation* o = pa_context_get_card_info_list(c, &QPulse::onGotCardInfoListSt, this);
|
||||||
|
if (! o) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pa_operation_unref(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QPulse::onGotCardInfoListSt(pa_context*, const pa_card_info *i, int eol, void *userdata)
|
void QPulse::onGotCardInfoListSt(pa_context*, const pa_card_info *i, int eol, void *userdata)
|
||||||
|
4
qpulse.h
4
qpulse.h
@ -13,8 +13,8 @@ public:
|
|||||||
|
|
||||||
pa_context_state_t ConnectionState();
|
pa_context_state_t ConnectionState();
|
||||||
|
|
||||||
void RequestServerInfo();
|
bool RequestServerInfo();
|
||||||
void RequestCardInfo();
|
bool RequestCardInfo();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ConnectionStateChanged();
|
void ConnectionStateChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user