Sitemap

Amicuk Programming Answers

Memory leak when passing variables to functions in StarOffice Basic

-0001-11-30   Views:0

Advertisement

The following code generates a fast memory leak: Sub Main Dim i&      for i = 1 to 1000000           Model(i)      next i End Sub Sub Model(j&)      j = j End Sub But if you put the contents of Sub Model into Main, or if you make j a public variab

The following code generates a fast memory leak:
Sub Main
Dim i&
     for i = 1 to 1000000
          Model(i)
     next i
End Sub
Sub Model(j&)
     j = j
End Sub
But if you put the contents of Sub Model into Main, or if you make j a public variable and don't pass it explicitly to Model, the memory leak disappears.
Message was edited by:
capnbob

The replay answer
Advertisement
That's a bit different for event handlers like the onRelease
event of buttons.
mybutton.onRelease = myfunction(1); -> the code will
execute right away without waiting for the event to fire
mybutton.onRelease = myfunction(); -> the code will
execute right away without waiting for the event to fire
mybutton.onRelease = myfunction; -> myfunction gets called
after the event onRelease fires.
See attached code.

Go to See the other 4 answers

Memory leak when passing variables to functions in StarOffice Basic

Category:DefaultRelease time:-0001-11-30Views:130

The following code generates a fast memory leak: Sub Main Dim i&      for i = 1 to 1000000           Model(i)      next i End Sub Sub Model(j&)      j = j End Sub But if you put the contents of Sub Model into Main, or if you make j a public variab[More]

Passing variable with function in AS3

Category:DefaultRelease time:-0001-11-30Views:130

This is a function on the first frame of a .fla updated to AS3 from an old AS2 file: function initialize() { MovieClip(root).stage_target_mc.max_messages = 600; When the function is called it should set "max_messages" to 600 in AS3, right? Thank[More]

Memory leak in a function registered using set_restore_function()

Category:DefaultRelease time:-0001-11-30Views:130

I experience a problem with memory leak caused by the following function: void RestorePhonemesSet(PhonemesSetStructType &phonemesSet, const void *src) { char p = (char ) src; memcpy(&phonemesSet.len, p, sizeof (int)); p += sizeof (int); memcpy(&am[More]

Passing variables: Functions

Category:DefaultRelease time:-0001-11-30Views:130

Sorry if this is nooby questions: How can i pass variables between functions in AS. I know how to return a value and you can pass parameters into a function but say I had an outer function (say "a") with a local var (say "vara") with a[More]

Fortran memory leaks

Category:DefaultRelease time:-0001-11-30Views:130

I'm trying to determine whether we have any memory leaks in our Fortran 95 program using check -leaks. We use several allocate and deallocate statements and using the showleaks command in dbx does show a memory leak, but nothing seems to change wheth[More]

What are different ways to pass variables in a c# program?

Category:DefaultRelease time:2015-10-11Views:130

What are different ways to pass variables in a c# program? I was wondering if : var numbers = textBox1.Text.Split(' .Select(int.Parse).ToArray(); var min = numbers.Min(); var max = numbers.Max(); textBox2.Text = string.Format("min: {0} max: {1}"[More]

I am experiencing a memory leak when I write to a file in a loop.

Category:DefaultRelease time:-0001-11-30Views:130

I am conducting a cycling test, each cycle represents about 48k of memory. I collect a selectable number of cycles into a shift register. When the chosen number of cycles is reached, I write the data to text files and then clear out the shift registe[More]

Memory leak with callback function

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I am fairly new to LabWindows and the ninetv library, i have mostly been working with LabVIEW. I am trying to create a basic (no GUI) c++ client that sets up subscriptions to several network variables publishing DAQ data from a PXI. The data for[More]

Memory leak problem while passing Object to stored procedure from C++ code

Category:DefaultRelease time:2015-10-11Views:130

Hi, I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code : 1) created objects in oracle with the help of "create or replace type as objects" 2) generated C+[More]

Memory leak in JCO when calling an ABAP-function that returns larg tables

Category:DefaultRelease time:2015-10-11Views:130

Hello everybody, I think discovered a memory leak in JCO when the calling functionions that have exporting tables with large datasets. For example the ABAP-function RFC_READ_TABLE, which in this example I use to retrieve data from a table called "RSZ[More]

Memory Leak in terminateConnection() function. How to resolve it ???

Category:DefaultRelease time:2015-10-11Views:130

Hi, We are facing a memory leak issue in terminateConnection() function. Here is a sample code regarding that. We have run around 1.5 hours simultaneously and it was consuming around 250MB for this simple program. How could I resolve this problem ? b[More]

Hot
I have had no issues with my calendar until I updated to 2.0 and now any new events in my calendar will not load to the phone. I have followed the tech support help up to the point of where they ask me to delete my contacts and calendar on my compute [More]
This may be a dumb question. I've just moved over from Windows. My 27in iMac came pre-installed with Lion and no install disks. In the event of a drive failure how would I re-install the operation system? In windows with a fresh drive I would have to [More]
Hello! I'm new at Lightroom2 and am getting ready to import all my current photographs on my hard disk to LR. I began doing this but am finding it very tedious. My current folder organization looks somewhat like this: each indent = a subfolder inside [More]
I do many documents for proof and regardless of how the end user is going to view them, I like them to open as a full page ("Fit Page" zoom level) - I want the viewer to get the overall impact of the layout before they see just the top half or u [More]
I have a 3 GS phone and would like to transfer my MSG to My PC so I could print the out. Is this possable please.Phone not recognised in itunes iPhone not recognised by iTunes on PCRead other 2 answers [More]
Dear experts: My origenal system is Italian system, when I log in with Chinese system and open a search help for a screen field, the pop up screen of the search help can not show the correct characters. So my question is what I should do to show the [More]
'Daily Mail Plus', the iPad edition of the UK daily newspaper 'Daily Mail', is now available in Newsstand. We published the first issue in the early hours of this morning. https://itunes.apple.com/gb/app/daily-mail-plus/id579607657?mt=8Since you're u [More]
Hey guys, I am working with a slow motion clip for the first time and I am realizing that there isn't really an easy workflow with this. First of all, the clip was filmed with the Canon 7D, 60 fps. When I put in on the timeline, obviously I get rid o [More]
Hi all, A few days ago I had my mobile number changed because I had malicious calls from unknown numbers ect. But my old number still shows up in the line 1 when I view call logs and it also shows up when I connect my BB to my computer. How can I cha [More]
Hi, I have created a directory on MS Active Directory using AL BPM 5.7.1. I can see that the fuego directory objects were created successfully in the "Active Directory Users and Computers" tool. However, in the AL BPM Admin Center, when I click [More]