#Null$ is needed for some APIsskywalk wrote:I never use #Null$. What is the downside if I continue to let PB manage its internal string buffers? Is there a memory leak or just excess memory use?
PureBasic 5.71 LTS is out !
Re: PureBasic 5.71 LTS is out !
sorry for my bad english
Re: PureBasic 5.71 LTS is out !
If you work a lot with Pointers and AllocateMemory it can lead to memory leaks.
With global variables it is not so critical yet, because they are overwritten again and again. But you have to be careful with memory.
With ClearStructure you can completely clean up the memory. But if you want to release only one string in the structure of the memory completely, you can use the following trick.
With the version before PB v5.70 it was enough to assign #Null$ from releasing the resource.
With global variables it is not so critical yet, because they are overwritten again and again. But you have to be careful with memory.
With ClearStructure you can completely clean up the memory. But if you want to release only one string in the structure of the memory completely, you can use the following trick.
With the version before PB v5.70 it was enough to assign #Null$ from releasing the resource.
Code: Select all
Macro FreeStructureString(_struct_, _offset_)
ClearStructure(_struct_ + _offset_, string)
EndMacro
Structure udtFoo
iVal.i
sVal.s
EndStructure
*mem.udtFoo = AllocateMemory(SizeOf(udtFoo))
*mem\iVal = 100
*mem\sVal = Space(1000000)
Debug PeekI(*mem + OffsetOf(udtFoo\sVal))
FreeStructureString(*mem, OffsetOf(udtFoo\sVal))
Debug PeekI(*mem + OffsetOf(udtFoo\sVal))
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PureBasic 5.71 LTS is out !
I will discuss further in your new thread...
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
- Psychophanta
- Addict
- Posts: 4997
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Lípetsk, Russian Federation
- Contact:
Re: PureBasic 5.71 LTS is out !
Congratulations and many thanks!
http://www.zeitgeistmovie.com
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB
Re: PureBasic 5.71 LTS is out !
Thank you, Fred and other PB tinkerers.
@Fred : it appears you forgot to include the promised constant to indicate whether the DPi option is checked in the Windows version. (see here)
@Fred : it appears you forgot to include the promised constant to indicate whether the DPi option is checked in the Windows version. (see here)
Last edited by Blue on Thu Aug 29, 2019 3:31 am, edited 1 time in total.
"That's not a bug..." said the programmer. "it's a feature! "
"Oh! I see..." replied the blind man.
"Oh! I see..." replied the blind man.
Re: PureBasic 5.71 LTS is out !
Does the News page need to be updated with this version? https://www.purebasic.com/news.phpFred wrote:Final version is out, thank you a lot for testing !
Re: PureBasic 5.71 LTS is out !
In progress.
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: PureBasic 5.71 LTS is out !
Fred wrote:In progress.
The happiness is a road...
Not a destination
Not a destination
Re: PureBasic 5.71 LTS is out !
Haha, dogs are so loyal friends.
Sent via mobile phone
Sent via mobile phone
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2024: 56y
"Happiness is a pet." | "Never run a changing system!"
"Happiness is a pet." | "Never run a changing system!"
- Kwai chang caine
- Always Here
- Posts: 5353
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: PureBasic 5.71 LTS is out !
Yes.....always loyal to my CREATOR MASTER FRED that i love, and for the lifeKurzer wrote:Haha, dogs are so loyal friends.
But when even, anxious to never see coming a new dog bowl, of the more and more great part of my life each day (With new bones interesting for me )
I know my MASTER do the maximum, it's why i wait, i wait, each day with a little hope....
But since the birth of a certain spider, sometime i have the feeling to live in the movie "Groundhog Day"
Time seems a hundred times longer for those who wait, than those who are expected.
And a thousand times more, when he receives no news.
As the extraordinary Albert could have said:
"Here !!!!! is a factual demonstration ....
of the relativity of time"
The happiness is a road...
Not a destination
Not a destination