libical / XbICalendar

Objective-C Wrapper for the libical library
Other
17 stars 19 forks source link

XbICComponent leaks memory with icalparser_parse_string #31

Closed monkeyfdude closed 9 years ago

monkeyfdude commented 9 years ago

Thank you the library. I use libical.a provided by you.

With Xcode instrumentation, I found following line leaks memory in XbICComponent.m

    icalcomponent *root = icalparser_parse_string([content cStringUsingEncoding:NSUTF8StringEncoding]);
    icalcomponent_free(root);
   0 libsystem_malloc.dylib malloc_zone_malloc
   1 libsystem_malloc.dylib malloc
   2 EX icalmemory_new_buffer /work/AndrewHalls/libical/scripts/libical/src/libical/icalmemory.c:262
   3 EX make_segment /work/AndrewHalls/libical/scripts/libical/src/libical/icalparser.c:222
   4 EX parser_get_param_name /work/AndrewHalls/libical/scripts/libical/src/libical/icalparser.c:287
   5 EX icalparser_add_line /work/AndrewHalls/libical/scripts/libical/src/libical/icalparser.c:884
   6 EX icalparser_parse /work/AndrewHalls/libical/scripts/libical/src/libical/icalparser.c:629
   7 EX icalparser_parse_string /work/AndrewHalls/libical/scripts/libical/src/libical/icalparser.c:1343
   8 EX +[XbICComponent componentWithString:] 

Do you have a fix for this?

Thanks

ahalls commented 9 years ago

I’ll take a look at this this week.

-- Andrew

On Jul 15, 2015, at 6:41 AM, monkeyfdude notifications@github.com wrote:

Thank you the library. I use libical.a provided by you.

With Xcode instrumentation, I found following line leaks memory in XbICComponent.m

icalcomponent *root = icalparser_parse_string([content cStringUsingEncoding:NSUTF8StringEncoding]);

Do you have a fix for this?

Thanks

— Reply to this email directly or view it on GitHub https://github.com/libical/XbICalendar/issues/31.

monkeyfdude commented 9 years ago

Hello,

Did you get a chance to look at this issue?

Thank you,

winterz commented 9 years ago

might be that XblCalendar is using an older version of libical. I don't know which version is used.

monkeyfdude commented 9 years ago

In ical.h

define ICAL_PACKAGE "libical"

define ICAL_VERSION "1.00"

I did try your latest XblCalendar but it has the same issue.

Could you point me to latest libical.a please??

ahalls commented 9 years ago

We are working on building a 2.0.x version of the library. I though it was committed … looking

-- A

On Jul 21, 2015, at 6:43 AM, monkeyfdude notifications@github.com wrote:

define ICAL_PACKAGE "libical"

define ICAL_VERSION "1.00"

I did try your latest XblCalendar but it has the same issue.

Could you point me to latest libical.a please??

— Reply to this email directly or view it on GitHub https://github.com/libical/XbICalendar/issues/31#issuecomment-123078079.

ahalls commented 9 years ago

I've built the library with libical library tag: 1.0.1
Our tag is "0.3.2" this is the library pulled with podspec

In ical.h

define ICAL_PACKAGE "libical"

define ICAL_VERSION "2.0"

I can not detect a memory leak now.

Please let me know if you still have an issue.

monkeyfdude commented 9 years ago

thank you so much...will update the ticket