- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a DLL, with a stub along the lines of
sub DoStuff(iStatus)
double precision, allocatable:: work(:)
if (iStatus .eq. 1) then
allocate(work(mySize), STAT = iDid)
elseif (iiStatus .eq. 2) then
deallocate(work, STAT = iDid)
endif
The allocation works. When the subroutine is called a second time, the work array has been deallocated. I thought that an allocated array stayed allocated until an explicit deallocate. Do I need a SAVE atribute to be added to this array?
On a different note, the DLL works the first time it is called. It will run in the debugger when I step through it. When I do not step through it, or when I run it outside the debugger, it crashes. If, within the VB caller, I add a Debug.Print statement upon the return from the subroutine, it again runs. Any idea as to the cause of this behaviour?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page