mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-25 23:45:58 +01:00
screencast: protect against NULL stream in xdpw_pwr_stream_destroy()
- this allows repeated calls of xdpw_pwr_stream_destroy() on a single screencast instance
This commit is contained in:
parent
dbe71a66c7
commit
d2fa4aa5e7
1 changed files with 4 additions and 0 deletions
|
@ -230,6 +230,10 @@ int xdpw_pwr_context_create(struct xdpw_state *state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void xdpw_pwr_stream_destroy(struct xdpw_screencast_instance *cast) {
|
void xdpw_pwr_stream_destroy(struct xdpw_screencast_instance *cast) {
|
||||||
|
if (!cast->stream) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
logprint(DEBUG, "pipewire: destroying stream");
|
logprint(DEBUG, "pipewire: destroying stream");
|
||||||
pw_stream_flush(cast->stream, false);
|
pw_stream_flush(cast->stream, false);
|
||||||
pw_stream_disconnect(cast->stream);
|
pw_stream_disconnect(cast->stream);
|
||||||
|
|
Loading…
Reference in a new issue