# RxSwift resources not released

**URL:** <https://forums.kodeco.com/t/rxswift-resources-not-released/42245>\
**Category:** RxSwift\
**Created:** [May 4, 2018, 3:12pm UTC](https://forums.kodeco.com/t/rxswift-resources-not-released/42245 "2018-05-04T15:12:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zishanj](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@zishanj](https://forums.kodeco.com/u/zishanj)\
**Post date:** [May 4, 2018, 3:12pm UTC](https://forums.kodeco.com/t/rxswift-resources-not-released/42245/1 "2018-05-04T15:12:03Z")

</div>

After studying the book I have tried to create a custom player component in xib file that includes buttons like play, pause, forward, backward etc. I have then used @IBDesignable class named Player that initializes this player in a view. All @IBOutlet for buttons are declared as public in this class with weak var reference.

I am using ViewController and trying to bind the player buttons from above custom component reactively in this way:

viewPlayer.btnPlayer.rx.tap  
.subscribe(onNext: { [weak self] \_ in  
// other operational codes go here  
}).disposed(by: disposeBag)

Now the issue is, when I close the controller btnPlayer tap subscription does not disposed off and it still occupy some resources. Whereas other controls which are defined in this ViewController file get disposed off automatically. Any idea why is this happening and how to overcome it?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [November 1, 2018, 10:20pm UTC](https://forums.kodeco.com/t/rxswift-resources-not-released/42245/3 "2018-11-01T22:20:56Z")

</div>

Opened on November 1, 2018, 10:20pm UTC


