Jump to content

Dalija Prasnikar

Members
  • Content Count

    496
  • Joined

  • Last visited

  • Days Won

    46

Dalija Prasnikar last won the day on March 26

Dalija Prasnikar had the most liked content!

Community Reputation

698 Excellent

5 Followers

Technical Information

  • Delphi-Version
    Delphi 10.4 Sydney

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Dalija Prasnikar

    Delphi 10.4.2 Professional

    As long as we have power, all is good
  2. Dalija Prasnikar

    Delphi 10.4.2 Professional

    You can also try disabling package cache, it helped in my case. You need to edit registry key HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\21.0\Package Cache and then set the DisableAll value to 1. If it does not exist add new DWORD value with that name. But 10-12 seconds is really long time. Maybe something else is in play. If disabling Live Bindings and package cache does not help I would recommend filing bug report at https://quality.embarcadero.com/
  3. Dalija Prasnikar

    TLightweightMREW considerations

    Locks of any kind used as field in a class are meant to protect integrity of the data inside object instance, not to protect that instance from being destroyed. If you need to protect particular TMyClass instance itself, you will need to use some outer locking mechanism.
  4. Dalija Prasnikar

    Several F2084 Internal Error on Delphi 10.4.2

    The most similar would be Delphi XE, but that is not a long jump 🙂 Every new version has some features and some differences, and you will need to tweak some code to adjust in order to benefit from those features. The more recent version you use, the less future tweaking will be required. From that perspective, probably the most stable recent version is Tokyo - 10.2.3. Rio - 10.3.3 is also quite usable, but it does have less stable debugger, and new IDE styling can cause performance issues on low end machines. All those versions have better support for using high DPI in your applications. If high DPI is not imperative for you, and you are less inclined to make huge jump, then XE7 is probably the most stable version in between. XE7 is also good option if your code uses class helper for gaining access to private class members, since that was removed in Berlin 10.1.
  5. Dalija Prasnikar

    Several F2084 Internal Error on Delphi 10.4.2

    While 10.4.2 is a bit unstable (fortunately, my code does not choke it too often), going down to D2010 seems like overkill. There are many stable releases in between you can productively work with, and then move to 10.4.2 when patched.
  6. OK, long timeout was a bit confusing and I could not determine how long each operation should last. As far as I can see there are no obvious reasons why your approach fails with timeout. It is a bit longish code, so I am not excluding possibility of not catching error in code and possibility of some memory corruption, but that would commonly show much sooner. Using TTask and reusing threads through its thread pool is definitely faster and more correct approach comparing to creating anonymous threads. Anonymous threads was "fallback" suggestion in case your overall time spent in calculation is long enough so that creating thread overhead pays off. If the TTask is really the issue here (which is also hard to say) another option would be trying some other library. One thing you probably can confirm, by using anonymous threads is that TTask is the culprit here (even though you can never say that with 100% certainty).
  7. Since, your timeout is quite large, I suppose your requirement is not real-time resizing. In that case AnonymousThread approach can be good enough. I would also suggest using TTask wait without timeout, but 10 seconds is quite long time period, so it is quite possible there are other problems with TTask, and that using no timeout would just hang indefinitely (it might be worth trying, though). If the AnonymousThread approach is not good enough (creating and starting thread takes time - not much, but still) then creating reusable dedicated threads that would take care of resampling could be an option. But that is the most complicated approach, because you would need to communicate back and forth with such long running threads and pass data in and out as it finishes processing pieces of data. It is possible that there are libraries that have something you can reuse - the first place I would look for is OmniThreadLibrary https://github.com/gabr42/OmniThreadLibrary
  8. Without going into the why you are getting timeout, could be the issue @Vandrovnik mentioned, could be something else. Depends on your machine, number of cores, system activity too. But, if you are resampling video frames, that suggests that you are resizing same sized frames to same output size. In that case, calculating contributor weights for each frame again is huge waste. Calculate that once, and then just reuse it.
  9. Dalija Prasnikar

    I will be less active for a few weeks

    Ouch.... I wish you full recovery.... I would also say speedy, but you don't recover fast from that thingy.... I also had mild symptoms (I had way worse flu infections), but fatigue is beyond extreme... I literally slept for a month. Absolutely. It is quite bad experience even with mild symptoms.
  10. Dalija Prasnikar

    caFree & ,Free??

    I suggest that you read once again what @Remy Lebeau posted. You example is horrible and no amount of dancing around it will ever make it work properly. When you run it, and it works... that will only be an illusion caused by undefined behavior and a touch of luck.
  11. Dalija Prasnikar

    caFree & ,Free??

    And that is exactly the situation OP has encountered here. I guess you missed that part.
  12. Dalija Prasnikar

    caFree & ,Free??

    No. It is not OK. You are trying to release the form twice. Once explicitly by calling Free and once by setting on close Action to caFree. This may work under some circumstances, like @balabuev mentioned caFree triggers posting CM_RELEASE message to the form window handle. If there is no code that will pump the message queue (like Application.ProcessMessages) between the time OnFormClose is called and your explicit call to Free, then calling Free will actually destroy the form and along with it its window handle and message posted to that handle will be discarded because window no longer exists. However, if CM_RELEASE message is processed and handled before your explicit Free call, form will already be destroyed at the point you call Free and hence the error you are seeing (presumably from EurekaLog) Because you have added some other code in between that is calling Application.ProcessMessages. You have to choose one option. Either you will use caFree or you will use Free. Using both and hoping for the best is not good option even if it works, because it can be easily broken, which you now have first hand experience. If you need to retrieve some value from the form after it is closed, then you shouldn't use caFree anyway because you may access dead form - again depending on the other surrounding code. Another reason to explicitly Free form is that this makes memory management more obvious. You create form, do something with it, and then you release it.
  13. Dalija Prasnikar

    caFree & ,Free??

    ShowModal is not supported on Android and it is not recommended on iOS, and if you trust documentations it should be safe to use on macOS. Issue is most likely caused by some other code, not your general form handling code that you have here. http://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.Forms.TCommonCustomForm.ShowModal Your form handling is mostly correct. I would remove SaveFormPos from finally block because if something goes wrong you most likely don't want to save your form position. Also, if SaveFormPos can raise an exception, you will leak the form because FreeAndNil will not be called in that case. Also I would put f.var assignment inside try... block, because if that assignment raises and exception you will also leak form. And since form variable f is local variable and it is going out of scope right after you are releasing it, there is very little point in calling FreeAndNil, simple f.Free is enough.
  14. Dalija Prasnikar

    Learning Delphi

    Generally, books are the best resource for learning any language. More experienced developers can usually get they way around new language faster, so official documentation might suffice. Anyway, Delphi Language Guide is always a good place to start http://docwiki.embarcadero.com/RADStudio/Sydney/en/Delphi_Language_Guide_Index
  15. CB can use most of the Delphi code, but not all.
×