Yalantis/Segmentio

Memory leak in BadgeViewPresenter

Closed this issue · 1 comments

Report a bug

What did you do?

Created a segmentio in storyboard, connected to view controller, setup with configs, add a valueDidChange handler.

When running the project in Instruments, it indicates that there is a leak in BadgeViewPresenter. Upon initial inspection of the code in the class I'm not seeing where it is.

Your Environment

  • Version of the component: ~> 3.0
  • Device: simulator
  • Xcode version: 9.2
  • Cocoapods:

Stack

   CocoaPods : 1.4.0
        Ruby : ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
    RubyGems : 2.6.11
        Host : Mac OS X 10.13.3 (17D47)
       Xcode : 9.2 (9C40b)
         Git : git version 2.13.2
Ruby lib dir : /usr/local/Cellar/ruby/2.4.0/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ b37b621554653e3f84d96c271256acbf80fa9ef2

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '11.0'

inhibit_all_warnings!

def pods
  pod 'CFAlertViewController', '~> 3.0'
  pod 'Device', '~> 3.0'
  pod 'FacebookCore', '~> 0.3'
  pod 'FacebookLogin', '~> 0.3'
  pod 'Firebase', '~> 4.8'
  pod 'FirebaseAuth', '~> 4.4'
  pod 'FirebaseDatabase', '~> 4.1'
  pod 'FirebaseHelper', '~> 1.0'
  pod 'GroupWork', '~> 0.0'
  pod 'MessageKit', '~> 0.13'
  pod 'NotificationBannerSwift', '~> 1.6'
  pod 'PureLayout', '~> 3.0'
  pod 'SearchTextField', '~> 1.2'
  pod 'Segmentio', '~> 3.0'
  pod 'SkyFloatingLabelTextField', '~> 3.4'
  pod 'Spring', '~> 1.0'
  pod 'SwiftLint', '~> 0.24'
  pod 'SwiftMessages', '~> 4.1'
  pod 'SwiftVideoBackground', '~> 2.1'
  pod 'SwiftyButton', '~> 0.8'
  pod 'FontAwesome.swift', '~> 1.3'
  pod 'WQNetworkActivityIndicator', '~> 0.1'
end

target 'Proxy' do
  use_frameworks!

  pods

  target 'ProxyTests' do
    inherit! :search_paths
    pods
  end

  target 'ProxyUITests' do
    inherit! :search_paths
  end

end

Project that demonstrates the bug

https://github.com/quanvo87/Proxy

Same issue here. I had a crash on my app with this error message in the console Message from debugger: Terminated due to memory issue.

So I just launch Leaks from Instruments and it detects leaks on allocating init BadgeViewPresenter