DevCompiler.CompileSubs need cleanup

DevCompiler.CompileSubs need cleanup

Postby luowy » Fri Nov 19, 2021 8:23 am

This procedure does not clean up resources , so the last module file will be opening until next compile action;
it's easy to check this issue:
1,create a sub with only single src module; Test/Mod/Clean.odc, and close it;
2,do the command "^Q DevCompiler.CompileSubs Test ",
3,delete the module file "Clean.odc" in the file browser, The system warns that the file is being used;
4, compile a module(any) in BB, then the Clean.odc file can be deleted!

the fixup is:
Code: Select all
StdCoder.Decode ..,, ..JQ....3QwdONl9RhOO9vRbf9b8R7fJHPNGomCrlAyIhgs,CbKBhZ
 xi2,CoruKu4qouqm8rtuGfa4.hOO9vRb1Y66wb8RTfQ9vQRtIdvPZHWKqtCa.E.U5UWq.6.5Qw
 dONlnayKmKKqCLLCJuGqayKm6F9vQ5nsH3.bnayKmKa2,Cor.kay4.qorGqmQCU2,CJuyKtQC9
 8P9PP7ONbXmb.2.Qi2k5kpG.,6.kf4.86.QC18RdfQHfMf9R9vQ7ONb1E.kHE.0.p.0.4.0EJY
 jyC.6.VQ.k3k.8Mtf.2.m00.e,2.AU.Ue.E.mP,U9U.Q1IU0Ky8.,Uq.,UO.,.1.e0M.6YE.O,
 .3c36.7c.QU0Ky8.,UbU.2.e,2..e06.2UE04.GE,9T3U...p.0kzV.EJ.2U.2GEGk.q.6.AU1
 .JF.YUVU.I0wz72eGxd1hc2heGhcUQcjhhkBhghgHhiWRieQbBAV7oe,JeUQipJgABhnZiu2YC
 BghhgCxhYhgU2Ze2YdphUYiZ3johiVZhUwhmZgZJiUIZdQbUogdZhZZddRio,.r76Fd8,,5vPP
 9QHXUwhmZAk4ak2aEnaKqKKR0Gb44.NvP5fC,dFH9P9vQR7HTvM19RTfQr76RPMPPNp76BOOEb
 4qqQbBAV7AVqJbUoedhAb1QbUYiu2YIhgsZiBVglaUv2YZJimxhmJbUIcDxdAhc,pdvgV7Ic3x
 c7pdBAV7gdVRhZRepJAnvQdPNPvQFtQffMEK0GnaKqY7AZvgV7cN66pND,dNH9Pm2in4ak2SJY
 aIaKIEOqo66576ROGN867uHPM0HM0b8R79FHPMNvPDf9DONdvIffMNuP598BPONHLuqk69,d6P
 uP7f6N76NvP599,dP1PPamRqk2cR,dCv76hOO9ntwdgZgKBBWGqyql..aIX0GIOLECGEu2H76B
 76FdRaod0Ge2Dh0bHfkI0GeWoWuo4aU7AVo3YugbUoicYeZ3Dkt.Hd9d8OHvQPuP7PNWmIin4k
 2GorWGumGECJuGKayqnuGuKKwYZU2ag2YYhgaxhkZig2YZJimlIin4a.HMGggmJC0GeWoW2YKB
 BCbD3iZphcoig2Yg,EKod7Z7rN1M0GomOra4Ktiqm8rtumdWqrSLXaKtCLuKIt8rr2ZoZ3dONo
 8kkuqwamRq.aUnxhpJiXhgG3Yug5ROGNuCPM0A,LONZfP99PRtENPN1fPf9QrN1HU7cI98JfeI
 RO1HM0akWuIWqk2ak2kRq.O40GRcNc9KKwGr4ak2K2kt.UC,Q7..MFRGECorq4Q8Qb0CyIhACo
 ruKu8rrmKqKKtCLLYC58RZ9P7ONbvM,Mwd0.UiQcjpho,YcZRiX3.5011.85...CLL.U2V.IS6
 .636.M00.,..1cUXDJ9XGhighgmRiiQ88pum470,Mwd0UnpZGhighA70,cw56.2U.kJl1kFF.0
 U1Ws,QiiQ8CJuaLqKKWKqt2Ul1.RVtZBE.8T22.,.E2EhE.0.32.oZ,ZC.GYn7.G.0..676.16
 .6.665hK2.,6TxR.WnlM.M.6.,U0Ky8.,..e,2.A.c8m50.,6Y1.0..BN....
 --- end of encoding ---
luowy
 
Posts: 83
Joined: Thu Dec 17, 2015 1:32 pm

Re: DevCompiler.CompileSubs need cleanup

Postby Zinn » Sat Nov 20, 2021 7:37 am

(1)
A similar problem: When I edit a document (file) inside BlackBox, save it and close the edited window. The document (file) is still allocated by BlackBox and can't be deleted before I leaving BlackBox.
(2)
Another problem is: I have open a file in BlackBox twice (the same file open first interactive and open second via program) and close the second one via procedure Close inside the program. Then the interactive file will Trap after further use. This kind of problem about using Close exist since BlackBox version 1.5 There is something different to version 1.4 I don't know what it is.

- Helmut
Zinn
 
Posts: 114
Joined: Mon Nov 24, 2014 10:47 am
Location: Frankfurt am Main

Re: DevCompiler.CompileSubs need cleanup

Postby luowy » Wed Nov 24, 2021 9:58 am

Zinn wrote:(1)
A similar problem: When I edit a document (file) inside BlackBox, save it and close the edited window. The document (file) is still allocated by BlackBox and can't be deleted before I leaving BlackBox.
(2)
Another problem is: I have open a file in BlackBox twice (the same file open first interactive and open second via program) and close the second one via procedure Close inside the program. Then the interactive file will Trap after further use. This kind of problem about using Close exist since BlackBox version 1.5 There is something different to version 1.4 I don't know what it is.

- Helmut

1) I fixed this issue a long time ago, forgot to submit this patch to the center;here you can check it:
HostFiles
Code: Select all
StdCoder.Decode ..,, ..BZ....3QwdONl9RhOO9vRbf9b8R7fJHPNGomCrlAyIhgs,CbKBhZ
 xi2,CoruKu4qouqm8rtuGfa4.hOO9vRb1Y66wb8RTfQ9vQRtIdvPZHWKqtCa.E.U5UO5,2.5Qw
 dONlnayKmKKqCLLCJuGqayKm6F9vQ5nsH3.bnayKmKa2,Cor.kay4.qorGqmQCU2,CJuyKtQC9
 8P9PP7ONbXmb.2.Qp4k5kFP.,E.EU7.86.QC18RdfQHfMf9R9vQ7ONb1E.kHE.0.p.0.4.I3tf
 j1.0E65.A.AU0Ky8.,Ub.,UO.,kmqA0E.e0.,6YU1V0IkmL,6..EBU.wT2U.EJ.6.V2I,AU9i.
 yz2WGJ0mtGromKq0mouKEKrtKKEqHT0mq4qpKKEaKu0mkuqruqwqqrKrtmGECLu4KuKKRqHEWq
 oGKmKKr0GJam4aEc8pbCoWGoe8pW0mVWqmCqpCIqyqtKKJWGqyqleHayql4KuyKtinYuIEuqkq
 qmenU8Jd4og0mbOIECIY4IdiHf4Id0GtKqtenYuIeKoXKIdamRqk2aEf4Id0GnuqkqqmocpZhg
 pdVhBrN1H.ohphhg2YiJbUAdCZe3Vv2YaJbUocdZhZRbUYih3iu2Y4higZBEE4KuG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9T3U...p.0.4.I3E.6.VQ.E...qS1...
 --- end of encoding ---

The blue text is the added code,after patching and compiling, you need to rebuild a new BB exe file to replace the old one
Code: Select all
DevLinker.Link
BlackBox2.exe := Kernel$+ Files HostFiles StdLoader
1 Applogo.ico 2 Doclogo.ico 3 SFLogo.ico 4 CFLogo.ico 5 DtyLogo.ico
1 Move.cur 2 Copy.cur 3 Link.cur 4 Pick.cur 5 Stop.cur 6 Hand.cur 7 Table.cur


2) if you want to open a file in BB command script(program) and close it as soon as possible, the better way is used "exclusive" mode instead of "shared" at first:
Code: Select all
  f:=Files.dir.Old(loc, name, FASLE); canClose:=TRUE;
  IF f = NIL THEN
     f:=Files.dir.Old(loc, name, TRUE); canClose := FALSE;
  END;
  ..
  IF canClose THEN f.Close() END;

Because document editing always uses shared mode files, before patch, the close window did not close file, and some service action, some global variables maybe holding it...if you open file with shared mode and will get the opening file,forcibly closing it will get traps! so the principle is: Only close exclusive files!
luowy
 
Posts: 83
Joined: Thu Dec 17, 2015 1:32 pm

Re: DevCompiler.CompileSubs need cleanup

Postby luowy » Fri Nov 26, 2021 4:53 am

How to test the effect of this patch:

before the patch
1, open a document, and close it
2. delete its files in the file browser of the OS, the delete operation can be completed
3, restore the file from recycler,reopen it's document in BB
4, copy a selection text using "ctrl+c", and close it's window
5, delete its files in the file browser of the OS, the delete operation can't be completed!

after the path:
1,2,3,4 same as before
5 is different , the delete operation can be completed!

that means: a document's file is closed as soon as it's window is closed;
luowy
 
Posts: 83
Joined: Thu Dec 17, 2015 1:32 pm


Return to Bug

Who is online

Users browsing this forum: No registered users and 2 guests

cron