TheProjecter / objectiveflickr

Automatically exported from code.google.com/p/objectiveflickr
Other
0 stars 0 forks source link

Essential code is in asserts, and does not run when asserts are disabled #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some essential code is executed within the condition clause of NSAssert 
statements. If asserts are 
disabled by defining the NS_BLOCK_ASSERTIONS macro, this code does not execute 
and image 
uploading (and potentially other operations) fails.

For an example, see

http://github.com/lukhnos/objectiveflickr/blob/9252ed584d063c5d34e9787c3fc5a9538
c169199/
Source/ObjectiveFlickr.m

Line 421.

I've attached a patch that fixes this problem to the extent that I experienced 
it. There could be 
other locations in the code base where the same technique needs to be applied.

Original issue reported on code.google.com by john%hig...@gtempaccount.com on 11 Sep 2009 at 2:12

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for informing me about this! I never use NS_BLOCK_ASSERTIONS so didn't 
think about the fact that 
those NSAssert's require side-effect for them to happen, and if one decides to 
take them out in e.g. Release 
config, bad things do happen.

So yes I make the changes. Probably will use the one suggested here, 
http://www.cocoabuilder.com/archive/message/cocoa/2008/4/3/203168 , so that we 
use less #ifdef's

By the way, I recommend that we file bugs at 
http://github.com/lukhnos/objectiveflickr/issues , since I 
stooped using Google Code project site for ObjectiveFlickr.

Once again, thanks for bringing this up!

Original comment by lukh...@gmail.com on 11 Sep 2009 at 7:43

GoogleCodeExporter commented 9 years ago
Correct: I'll make the changes shortly.

Original comment by lukh...@gmail.com on 11 Sep 2009 at 7:44

GoogleCodeExporter commented 9 years ago
Glad I could help!

Original comment by john%hig...@gtempaccount.com on 11 Sep 2009 at 6:42

GoogleCodeExporter commented 9 years ago
Hi,

I've updated ObjectiveFlickr and made the changes using the information from 
the patch:

http://github.com/lukhnos/objectiveflickr/commit/518062aabee5e110805d32cf379d69d
9f67ab862

Thanks again for the contribution!

Original comment by lukh...@gmail.com on 12 Sep 2009 at 2:52