Skip to content

Commit c451da3

Browse files
committed
Fix process leak (#561)
1 parent 46558dc commit c451da3

8 files changed

Lines changed: 24 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Changelog
22

3+
# 0.11.4
4+
* Fix process leak. [#561](https://github.com/membraneframework/membrane_core/pull/561)
5+
36
# 0.11.3
4-
* Fix bug in `c:Membrane.Pipeline.handle_call/3` [#526](https://github.com/membraneframework/membrane_core/pull/526).
7+
* Fix bug in `c:Membrane.Pipeline.handle_call/3` [#526](https://github.com/membraneframework/membrane_core/pull/526)
58

69
# 0.11.2
710
* Fix bug in Membrane.ChildrenSpec.child/3 spec.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This package provides core of the [Membrane Multimedia Framework](https://membra
2323
Add the following line to your `deps` in `mix.exs`. Run `mix deps.get`.
2424

2525
```elixir
26-
{:membrane_core, "~> 0.11.3"}
26+
{:membrane_core, "~> 0.11.4"}
2727
```
2828

2929
## Getting started

guides/upgrading/v0.11.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Improvements in v0.11 required some breaking changes, so here comes the guide th
44

55
## Deps upgrade
66

7-
Update `membrane_core` to `v0.11.3`
7+
Update `membrane_core` to `v0.11.4`
88
```elixir
99
defp deps do
1010
[
11-
{:membrane_core, "~> 0.11.3"},
11+
{:membrane_core, "~> 0.11.4"},
1212
...
1313
]
1414
end

lib/membrane/core/bin.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ defmodule Membrane.Core.Bin do
9494
Membrane.Core.Observability.setup(observability_config)
9595
SubprocessSupervisor.set_parent_component(options.subprocess_supervisor, observability_config)
9696

97-
clock_proxy = Membrane.Clock.start_link(proxy: true) ~> ({:ok, pid} -> pid)
97+
{:ok, clock_proxy} =
98+
SubprocessSupervisor.start_utility(
99+
options.subprocess_supervisor,
100+
{Membrane.Clock, proxy: true}
101+
)
102+
98103
clock = if Bunch.Module.check_behaviour(module, :membrane_clock?), do: clock_proxy, else: nil
99104
Message.send(options.parent, :clock, [name, clock])
100105

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.Mixfile do
22
use Mix.Project
33

4-
@version "0.11.3"
4+
@version "0.11.4"
55
@source_ref "v#{@version}"
66

77
def project do

test/membrane/core/element/action_handler_test.exs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule Membrane.Core.Element.ActionHandlerTest do
22
use ExUnit.Case, async: true
33

4-
alias Membrane.{ActionError, Buffer, ElementError, PadDirectionError}
4+
alias Membrane.{ActionError, Buffer, ElementError, PadDirectionError, UnknownPadError}
55
alias Membrane.Core.Element.State
66
alias Membrane.Support.DemandsTest.Filter
77
alias Membrane.Support.Element.{TrivialFilter, TrivialSource}
@@ -166,7 +166,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
166166
test "when pad doesn't exist in the element", %{state: state} do
167167
state = %{state | playback: :playing}
168168

169-
assert_raise MatchError, ~r/:unknown_pad/i, fn ->
169+
assert_raise UnknownPadError, fn ->
170170
@module.handle_action(
171171
buffer_action(:invalid_pad_ref),
172172
:handle_info,
@@ -289,7 +289,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
289289
test "when pad doesn't exist in the element", %{state: state} do
290290
state = %{state | playback: :playing}
291291

292-
assert_raise MatchError, ~r/:unknown_pad/i, fn ->
292+
assert_raise UnknownPadError, fn ->
293293
@module.handle_action(
294294
event_action(:invalid_pad_ref),
295295
:handle_info,
@@ -360,7 +360,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
360360
test "when pad doesn't exist in the element", %{state: state} do
361361
state = %{state | playback: :playing}
362362

363-
assert_raise MatchError, ~r/:unknown_pad/i, fn ->
363+
assert_raise UnknownPadError, fn ->
364364
@module.handle_action(
365365
stream_format_action(:invalid_pad_ref),
366366
:handle_info,
@@ -424,7 +424,7 @@ defmodule Membrane.Core.Element.ActionHandlerTest do
424424
test "when pad doesn't exist in the element", %{state: state} do
425425
state = %{state | playback: :playing}
426426

427-
assert_raise MatchError, ~r/:unknown_pad/i, fn ->
427+
assert_raise UnknownPadError, fn ->
428428
@module.handle_action(
429429
{:redemand, :invalid_pad_ref},
430430
:handle_info,

test/membrane/core/element/pad_model_test.exs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
defmodule Membrane.Core.Child.PadModelTest do
22
use ExUnit.Case, async: true
33

4+
alias Membrane.UnknownPadError
5+
46
require Membrane.Core.Child.PadModel, as: PadModel
57

68
defp setup_element_state(_ctx) do
@@ -45,7 +47,7 @@ defmodule Membrane.Core.Child.PadModelTest do
4547
end
4648

4749
test "is :unknown_pad when the pad is not present", ctx do
48-
assert_raise MatchError, fn ->
50+
assert_raise UnknownPadError, fn ->
4951
PadModel.get_data!(ctx.state, :output, :demand)
5052
end
5153
end
@@ -76,7 +78,7 @@ defmodule Membrane.Core.Child.PadModelTest do
7678
end
7779

7880
test "raises when the pad is not present", ctx do
79-
assert_raise MatchError, fn ->
81+
assert_raise UnknownPadError, fn ->
8082
PadModel.set_data!(ctx.state, :other_input, :start_of_stream?, true)
8183
end
8284
end
@@ -105,7 +107,7 @@ defmodule Membrane.Core.Child.PadModelTest do
105107
end
106108

107109
test "raises when the pad is not present", ctx do
108-
assert_raise MatchError, fn ->
110+
assert_raise UnknownPadError, fn ->
109111
PadModel.update_data!(ctx.state, :other_input, :demand, &(&1 + 5))
110112
end
111113
end

test/support/bin/test_bins.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
defmodule Membrane.Support.Bin.TestBins do
22
@moduledoc false
3-
alias Membrane.ChildrenSpec
43

54
defmodule TestFilter do
65
@moduledoc false

0 commit comments

Comments
 (0)