Incorrect memory handling in tutorial code (chapter: OpenCV iOS - Image Processing) (Bug #3318)


Added by Samuel Wejeus over 11 years ago. Updated over 11 years ago.


Status:Done Start date:2013-10-14
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:ios
Target version:3.0
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty:Easy HW Platform:Other
Pull request:https://github.com/Itseez/opencv/pull/1671

Description

In the example code located at: http://docs.opencv.org/trunk/doc/tutorials/ios/image_manipulation/image_manipulation.html

The example code tries to release code that have not been retained using a call to CGColorSpaceRelease(colorSpace); Memory handling fundamentals for Core Foundation clearly says that you should not release anything if you have not created it yourself.

See bottom of page: https://developer.apple.com/library/ios/documentation/graphicsimaging/conceptual/drawingwithquartz2d/dq_overview/dq_overview.html for details.

Remedy: remove call to CGColorSpaceRelease(..).

Bug in 3.0 documentation but probably exists before that to.


Associated revisions

Revision eddaaa96
Added by Samuel Wejéus over 11 years ago

Removed incorrect release of obtained colorspace. This fixes bug #3318 (updated commit for 2.4 branch)

Revision cae89a7a
Added by Alexander Alekhin over 10 years ago

Merge pull request #3318 from akarsakov:ocl_cvtcolor

History

Updated by Maria Dimashova over 11 years ago

Samuel, thanks for the bug report!
It would be great if you fix the bug and open pull request here Could you please do this to help OpenCV team?

Updated by Samuel Wejeus over 11 years ago

Ok. WIll do.

Updated by Dmitry Retinskiy over 11 years ago

  • Status changed from New to Done
  • Assignee deleted (Alexander Shishkov)
  • Pull request set to https://github.com/Itseez/opencv/pull/1671
  • % Done changed from 0 to 100

Also available in: Atom PDF