By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,538 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,538 IT Pros & Developers. It's quick & easy.

PyBuffer. Question on memory shared by C app and python.

P: n/a
Hi.

I have an app that allocates memory. I have created a python buffer that
shares this memory. Example:

data = (double*) malloc(size*sizeof(double));
buffer = PyBuffer_FromReadWriteMemory(data, size*sizeof(double));

The app and python interpreter does lots of things they find usefull.

And one day, the app decides to free the memory:

free(data);

How can the app tell python not to try to access memory no more?

Am I sure at this point that the app is the only one that has a ref on
my Object?

Thanks in advance for any suggestions.

Nicolas.

--
Noveltis

Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.