Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application Freeze on freelibrary with dll using LoggerPro #74

Closed
Basti-Fantasti opened this issue May 2, 2023 · 1 comment
Closed

Comments

@Basti-Fantasti
Copy link

I ran into this problem, that my application crashes / freezes every time when it gets shut down on the FreeLibrary call.

In that call, the LoggerPro destructor is called like this:

destructor TLogging.Destroy;
begin

  if self <> nil then
  begin
    _Log := nil;
    if System.IsLibrary then
    begin
      ReleaseGlobalLogger; // This is required inside dll and ISAPI!!
    end;
end;

it always freezes at the _Log := nil call.
I have implemented the ReleaseGlobalLogger; but this is never executed due to the freeze in the row before.
It seems to make no difference which loggers are used.

I tried only the FileLogger, only Syslog, but as soon as one instance of the logger is running, the calling App freezes...

Do you have any ideas what could cause this, or how can I further investigate into this...

@Basti-Fantasti
Copy link
Author

I managed to successfully circumvent the issue by calling the logging class destructor before calling the FreeLibrary (as suggested by you 😃 )

Now it works...

I also implemented your singleton approach for building the Logger as well as freeing the logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant