Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/30/20 in all areas

  1. Our iOS app, EarMaster, made with Delphi is now featured in App Store, in the "Best of the month - New apps we love". Nice to see that a Delphi app can get this kind of approval from Apple. PS. I am in Denmark, so I see the Danish app store, but I am curious to know, in what other countries it has been featured too?
  2. Dave Nottage

    Android 64bit and 32bit permissions

    You don't have Read Call Log and Read Phone Numbers permissions set in the Project Options for Android 64-bit.
  3. Stefan Glienke

    Memory Management with many objects

    I just scribbled something together that should be good enough to start with and get some basic information about how many objects are created at a given time - needs to be first or directly after the memory manager unit in the dpr: Replace the dictionary with a Spring4D one and you have some easy sorting and filtering on top 🙂 unit ObjectCounter; interface uses Generics.Collections; function GetObjectCounts: TDictionary<TClass,Integer>; implementation uses madCodeHook; type TObjectCounter = record class var ObjectCounts: TDictionary<TClass,Integer>; class var OldInitInstance: function (Self: TClass; Instance: Pointer): TObject; class var OldCleanupInstance: procedure (Self: TObject); class function InitInstance(Self: TClass; Instance: Pointer): TObject; static; class procedure CleanupInstance(Self: TObject); static; class procedure Init; static; class procedure Finalize; static; end; function GetObjectCounts: TDictionary<TClass,Integer>; begin Result := TObjectCounter.ObjectCounts; end; { TObjectCounter } class function TObjectCounter.InitInstance(Self: TClass; Instance: Pointer): TObject; var count: Integer; begin if ObjectCounts.TryGetValue(Self, count) then ObjectCounts[Self] := count + 1 else ObjectCounts.Add(Self, 1); Result := OldInitInstance(Self, Instance); end; class procedure TObjectCounter.CleanupInstance(Self: TObject); var count: Integer; begin if ObjectCounts.TryGetValue(Self.ClassType, count) then if count = 1 then ObjectCounts.Remove(Self.ClassType) else ObjectCounts[Self.ClassType] := count - 1; OldCleanupInstance(Self); end; class procedure TObjectCounter.Init; begin ObjectCounts := TDictionary<TClass,Integer>.Create; HookCode(@TObject.InitInstance, @InitInstance, @OldInitInstance); HookCode(@TObject.CleanupInstance, @CleanupInstance, @OldCleanupInstance); end; class procedure TObjectCounter.Finalize; begin UnhookCode(@OldInitInstance); UnhookCode(@OldCleanupInstance); ObjectCounts.Free; end; initialization TObjectCounter.Init; finalization TObjectCounter.Finalize; end.
  4. bazzer747

    Cannot perform this operation on a closed dataset

    Hi, Thanks for this, I've got monitoring working OK now. Although there is so much information it takes ages to find what I need. I'll play with the controls to try to restrict this output to just what I need to look at. Many thanks for the lesson. And Dany, thanks for the info. All very useful.
  5. Hans♫

    Just wanted to brag a bit :-)

    Thanks 🙂 I don't think that our FB activities have had any influence on Apples decision to feature EarMaster. From my point of view, FB advertising is useful if you have a free app and it targets something that people have a personal interest in. When you are viewing you FB news thread, you are not in "commercial mode", but instead you can easily be attracted by an add about something you are passionate about. It's however important to submit all in-app purchases to FB, so you can calculate the ROI, which is what we mainly use our FB integration for.
  6. Lars Fosdal

    How to use library from Delphi 10.1 DCUs in Delphi 10.3.3?

    It is a good way of black-boxing old code. The drawback of using DLLs is that versioning the interface becomes important. Want to add a parameter to a function? It will break the compatibility with the old DLL, so better to add a second function. Want to change a structure? Another break - unless you planned for it and have structure versioning and size info, and always add content at the end of the structure. Win32 is jam-packed with the above.
  7. Fr0sT.Brutal

    Memory Management with many objects

    I'd recommend to check if such memory consumption is expected. Then you can use FastMM's debug facilities to check allocated items, their exact size, types and many other details.
  8. Dave Nottage

    Linker errors when including Facebook SDK on iOS12

    If you're still having trouble, please look at line 175 here: https://github.com/DelphiWorlds/KastriFree/blob/master/API/DW.iOSapi.Firebase.pas Basically forces the linker to link to libclang_rt.ios.a, which has the "missing" symbol
  9. LeusKapus

    Sending Email via GMail Using OAuth 2.0 via Indy

    Guys, just a heads up: Google is deprecating access to "unsecure apps" for Gmail for Business this February 15th. It is very likely that they'll extend this to all Gmail any time soon.
×