[swift-users] Swift 2.0: JID & StringPrep::getPrepared

Kevin Smith kevin.smith at isode.com
Tue Jan 5 20:32:44 UTC 2016


Hi,

On 16 Dec 2015, at 16:44, Travis Loyd <fun.tloyd at gmail.com> wrote:
> When I perform a memory dump I can see a left over 'resource' portion from the JID after everything should have been cleaned up.
> 
> Detected memory leaks!
> Dumping objects ->
> {3598} normal block at 0x03094C48, 60 bytes long.
>  Data: < H  T23ykQ0zpp7Y> 88 48 09 03 54 32 33 79 6B 51 30 7A 70 70 37 59 
> {3588} normal block at 0x03094BD0, 60 bytes long.
>  Data: < :  ZylsMEQYJ5qu> F8 3A 09 03 5A 79 6C 73 4D 45 51 59 4A 35 71 75 
> {3578} normal block at 0x03094B58, 60 bytes long.
>  Data: <    C7l7Ptvz2T9N> 00 00 00 00 43 37 6C 37 50 74 76 7A 32 54 39 4E 
> ... snip ...
> 
> I'm looking for a fix.  Am I using something incorrectly?  Or, have I found a bug?  (Maybe related to StringPrep?)  Is there a more updated 2.0 library out there which I'm unaware of?  I've got the latest AFAIK.  Environment is Windows 7, Visual Studio 2010 & openssl.

I suspect what you’re seeing here isn’t a ‘leak’ per se, but the stringprep cache - https://github.com/swift/swift/blob/master/Swiften/JID/JID.cpp#L179 (Because stringprep is relatively expensive). You should be able to disable this at compiletime.

> Thank you for an amazing library!

Glad you like it :)

/K



More information about the swift-users mailing list