Hello,
-R-E- DXL: <Line:62> An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module doors.exe at 001B:009E89E4
Backtrace:
<Line:1142>
-R-F- DXL: <Line:62> internal error, please submit a bug report
Backtrace:
<Line:1142>
void memoryCleaner() {
Module mxopen = null
mxopen = null
///* DEBUG
/*
for mxopen in LoadedModule do {
string NameFull = key(LoadedModule)
print fullName(mxopen) " - " NameFull "\n"
}
*/
///*/
for mxopen in LoadedModule do {
if(null mxopen) continue
GlobStatusMod = fullName(mxopen)
Item GlobItmStatus = item GlobStatusMod
if((open module GlobStatusMod) || (baseline(mxopen))) {
if (fullName(mxopen) == fullName(m)"") continue
if (!null mxopen) {
///* DEBUG infoBox("Saving... "fullName(mxopen))
if(!isRead(mxopen)) {
noError()
save(mxopen)///* DEBUG {Saving without prompting...}
err = lastError()
if (!null err) {
errorBox(err)
continue
}
}
noError()
close(mxopen)
///* DEBUG {print "Closing... " fullName(mxopen) "\n"}
err = lastError()
if (!null err) {
string NameFull = key(LoadedModule)
errorBox(err "\n" NameFull)
continue
}
}
}
}
setempty(LoadedModule)
if(!isRead(m)) {
save(m)
}
downgrade(m)
}
SystemAdmin - Mon Mar 25 10:02:02 EDT 2013 |
Re: "An unexpected error has occurred" when attempting to close modules. Second, I've never seen "setempty" for Skips before! My intuition suggests it needs to be tested, and in any case will NOT work if you put structures in the skip (DATA is 'Skip' or 'Buffer' or whatever). I see line #62 is where you "GlobStatusMod = fullName(mxopen)", exception violations there mean that "mxopen" is non-null but corrupted or otherwise invalid. At line #1377 I see you "put" into LoadedModule a string name and a Module handle "xMod". "xMod" can still have the value it had in the PREVIOUS loop since the logic above it does not guarantee it gets set. Thus, your clean up will close it, then loop around and try to use the now-corrupted Handle. Also, "xMod" here can be null. I'm pretty sure this mistake is elsewhere in the code. I think if you reverse your skip list, KEY is the 'Module' and DATA is the 'string' name, you may have better luck.
However, consider this change:
This has the distinct advantage that you do NOT have to keep track of every module you open. The code I have to do this needs updating; such as making sure the Original modules are indeed still open; and looping twice through currently open modules, since a "close" may not work if some other module is keeping it open. -Louie |
Re: "An unexpected error has occurred" when attempting to close modules.
Hello,
//***********************
void fSkipDelSkip(Skip &skpIn)
{ // Delete the Skip list, first deleting all the 'Skip' list DATA elements.
// Be sure the Skip's DATA is type 'Skip'.
if (null skpIn) return
Skip skpData
for skpData in skpIn do
{ delete(skpData)
}
delete(skpIn)
} // end fSkipDelSkip()
Skip ListofList = create ()
Skip List1 = create ()
Skip List2 = create ()
Skip List3 = create ()
Skip List4 = create ()
Skip List5 = create ()
put(List1, 0, "List1")
put(List2, 0, "List2")
put(List3, 0, "List3")
put(List4, 0, "List4")
put(List5, 0, "List5")
put(ListofList, 0, List1)
put(ListofList, 1, List2)
put(ListofList, 2, List3)
put(ListofList, 3, List4)
put(ListofList, 4, List5)
string temp = null
Skip skp
for skp in ListofList do {
string temp = null
for temp in skp do {
print temp "\n"
}
}
print "'After setempty(ListofList)'\n"
setempty(ListofList)
temp = null
for skp in ListofList do {
string temp = null
for temp in skp do {
print temp "\n"
}
}
print "'After List1 print'\n"
temp = null
for temp in List1 do {
print temp "\n"
}
fSkipDelSkip(ListofList)
delete skp
//results
List1
List2
List3
List4
List5
'After setempty(ListofList)'
'After List1 print'
List1
|