Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 805593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:06:19+00:00 2026-05-15T00:06:19+00:00

I’m having memory woes. I’ve got a C++ Library (Equalizer from Eyescale) and they

  • 0

I’m having memory woes.

I’ve got a C++ Library (Equalizer from Eyescale) and they use the Traversal
Visitor Pattern to allow you to add new functionality to their classes.

I’ve finally figured out how it works, and I’ve got a Visitor that just
returns the properties from one of the objects. (since I don’t know how
they’re allocated).

so.

My little code does this:

VisitorResult AGLContextVisitor::visit( Channel* channel ) 
{ 
  // Search through Nodes, Pipes until we get to the right window. 
  // Add some code to make sure we find the right one? 

  // Not executing the following code as C++ in gdb? 
  eq::Window* w = channel->getWindow(); 
  OSWindow* osw = w->getOSWindow(); 
  AGLWindow* aw = (AGLWindow *)osw; 
  AGLContext agl_ctx = aw->getAGLContext(); 
  this->setContext(agl_ctx); 

  return TRAVERSE_PRUNE; 
} 

So here’s the problem.

eq::Window* w = channel->getWindow(); 
(gdb) print w 
0x0 

BUT If I do this:

(gdb) set objc-non-blocking-mode off 
(gdb) print w=channel->getWindow() 
0x300effb9 

// an honest memory location, and sets w as verified in the Debugger window
of XCode.

It does the same thing for osw.

I don’t get it. Why would something work in (gdb) but not in the code?

The file is completely a cpp file, but it seems to be running in objc++,
since I need to turn blocking off.

Help!? I feel like I’m missing some memory-management basic thing here,
either with C++ or Obj-C.

[edit]

channel->getWindow() is supposed to do this:

/** @return the parent window. @version 1.0 */
Window* getWindow() { return _window; }

The code also executes fine if I run it from a C++-only application.

[edit]

No… I tried creating a simple stand-alone program since I was tired of running it as a plugin. Messy to debug.

And no, it doesn’t run in the C++ program either. So I’m really at a loss as to what I’m doing wrong.

Thanks,

—
Stephen Furlani

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:06:20+00:00Added an answer on May 15, 2026 at 12:06 am

    I suppose I should answer and close this out.

    The methods I was using were completely thread-unsafe. I was calling out across threads, Carbon/Cocoa, C++/ObjC.

    Needless to say, don’t ever do that! I learned the hard way.

    -Stephen

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.