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

  • Home
  • SEARCH
  • 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 7429079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:54:45+00:00 2026-05-29T08:54:45+00:00

I am trying to fix a memory leak in Pyglet. It occurs only on

  • 0

I am trying to fix a memory leak in Pyglet. It occurs only on win32, as it involves IStream object, allocated by ole32.CreateStreamOnHGlobal not being freed.

You can find the issue #552 on Pyglet tracker by clicking here.

As you can see in the source code, the release of the stream was left out as a TODO item:

  • line 148
  • line 204

Comment in line 204 even includes my question: How to call IUnknown::Release on stream?

The stream is allocated in line 142. As pyglet does not relies on external dependencies, I don’t think I can use pywin32. All we know at the python side about the stream object is gdiplus.py line 53

LPSTREAM = c_void_p

So, this is my background – the situation and the limitations. Now, my question – again. How can I call IStream::Release if all I have is a pointer? I have a long-running process that loads different images every 5 seconds or so and it looks like it is an issue for me. I can understand C/C++ and I even do some programming from time to time, but I am not win32 api expert by any means. Help!

  • 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-29T08:54:46+00:00Added an answer on May 29, 2026 at 8:54 am

    pyglet includes a COM module that interfaces with IUnknown (pyglet.com, used by the dsound audio driver).

    This module didn’t exist when the GDI+ interface was written.

    You could rewrite the image loading to use COM objects instead of the C interface, or just use the steam pointer you have as the this pointer of an IUnknown.

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

Sidebar

Related Questions

I'm trying to fix a huge memory leak that is caused somewhere in a
I have got a really bad memory leak I am trying to fix, but
I'm trying to fix on an old, clunky, complicated legacy system with a memory
I'm trying to fix problem with COM object that has been separated from its
I am trying to fix memory leaks in IE 7. Using Drip for investigations
I'm trying to use XCode's Leaks utility to fix some memory leaks in my
I am trying to fix a bug on an ActiveX control. Is it possible
I'm trying to fix single quote bug in the code: std::string Index; connection->Open(); String^
I'm trying to fix something in some Objective C++ (?!) code. I don't know
I am trying to fix something in someone's website. Unfortunatley, the website is built

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.