<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
         IplImage* dispImg =<br>
bridge[2].imgMsgToCv(&(disparity_msg->image), "passthrough");<br>
<br>
</div>and let boost::shared_ptr do its magic.<br>
<br>
Or, is there something more subtle I just missed?<br>
<br></blockquote><div><br>shared_ptr will not (and cannot) autoconvert from a pointer.  Explicitly creating a shared_ptr naively from image in this case will cause shared_ptr to try and delete that pointer, which will crash since that pointer is not valid for deletion.<br>

<br>I believe you can do something like the following (untested):<br><br>sensor_msgs::ImageConstPtr image_ptr(disparity_msg, &disparity_msgs->image);<br><br>This will share the reference count with disparity_msg, but act like a pointer to an Image.<br>

<br>Josh<br></div></div>