Giter Site home page Giter Site logo

Comments (7)

leonskywalker avatar leonskywalker commented on August 29, 2024

I encountered the same issue when calling getDeviceList for the second time. I believe this is an MRC related issue (this library is using MRC according to its podspec). The static variable deviceList will be deallocated after first use.

from deviceutil.

InderKumarRathore avatar InderKumarRathore commented on August 29, 2024

Hi thanks for reporting this bug, seems like ARC has gone mad, it shouldn't come but the problem exists if I make static variable an ivar or something else. I will download the latest version of xcode and see if this remains.

Till then please use older version of pod i.e. ~> 1.2

from deviceutil.

InderKumarRathore avatar InderKumarRathore commented on August 29, 2024

Updated with a quick fix in 1.3.2

from deviceutil.

InderKumarRathore avatar InderKumarRathore commented on August 29, 2024

Converting this to enhancement as loading the plist file every time you call getDeviceList is bit CPU overhead. Until I find why the dictionary was being deallocated since static variable is strong by default this should remain as a feature or may be some other approach has to be implemented.

from deviceutil.

Coeur avatar Coeur commented on August 29, 2024
static const NSDictionary *deviceList;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
    ...// initialize your deviceList
});

from deviceutil.

InderKumarRathore avatar InderKumarRathore commented on August 29, 2024

Changed the class based APIs to instance based.

from deviceutil.

Coeur avatar Coeur commented on August 29, 2024

For reference: df4aa79

from deviceutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.