[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem in NSBundle while loading categories
From: |
Nicola Pero |
Subject: |
Re: Problem in NSBundle while loading categories |
Date: |
Tue, 26 Feb 2002 16:38:14 +0000 (GMT) |
I've spent quite some hours studying the NSBundle code and rewriting all
the NSBundle guile regression tests.
I'm going to apply your fix as part of other changes.
> Could somebody please make these changes to the CVS version as I do not have
> CVS write access. Thx.
>
> -----Original Message-----
> From: Gerrit Van Dyk [mailto:GerritVD@decillion.net]
> Sent: Tuesday, February 26, 2002 1:08 PM
> To: Discuss-Gnustep (E-mail)
> Subject: Problem in NSBundle while loading categories
>
>
> Hi all,
>
> With some of the recent changes to NSBundle, my app crashes when it tries to
> load a category contained within the bundle.
>
> I traced the bug to the _bundle_load_callback function within NSBundle. When
> a class is being loaded the "theClass" parameter is present but when a
> category is being loaded only the "theCategory" parameter is present. The
> function crashes when it tries to access the "theClass->name" variable, but
> this is not present when a category are loaded. I changed the function as
> follows and now everything works fine.
>
>
> void _bundle_load_callback(Class theClass, struct objc_category
> *theCategory)
> {
> const char *clsName;
>
> NSCAssert(_loadingBundle,NSInternalInconsistencyException);
>
> if (theCategory != 0)
> clsName = theCategory->class_name;
> else
> clsName = theClass->name;
>
> if (strlen(clsName) > 12 && strncmp("NSFramework_",clsName,12))
> return;
>
> ...The rest of the code as it was
> }
>
> Hope this helps to fix the bug
>
> Regards
> Gerrit van Dyk
>
> -------------------------------------------------------------------------
> This e-mail is intended only for the use of the individual or entity named
> above and may contain information that is confidential and privileged,
> proprietary to the company and protected by law. If you are not the intended
> recipient, you are hereby notified that any dissemination, distribution or
> copying of this e-mail is strictly prohibited. Opinions, conclusions and
> other information in this message that do not relate to the official
> business of our company shall be understood as neither given nor endorsed by
> it.
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep
>
> -------------------------------------------------------------------------
> This e-mail is intended only for the use of the individual or entity named
> above and may contain information that is confidential and privileged,
> proprietary to the company and protected by law. If you are not the intended
> recipient, you are hereby notified that any dissemination, distribution or
> copying of this e-mail is strictly prohibited. Opinions, conclusions and
> other information in this message that do not relate to the official
> business of our company shall be understood as neither given nor endorsed by
> it.
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep
>