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

Problem: error in destroyCoreClient (fix #346) #347

Merged
merged 1 commit into from
Jan 3, 2024
Merged

Conversation

leejw51crypto
Copy link
Collaborator

remove AsyncTask in destroyCoreClient

@leejw51crypto leejw51crypto requested a review from a team as a code owner December 28, 2023 14:39
@leejw51crypto leejw51crypto marked this pull request as draft December 29, 2023 02:32
@leejw51crypto leejw51crypto marked this pull request as ready for review December 29, 2023 06:53
@leejw51crypto
Copy link
Collaborator Author

leejw51crypto commented Dec 29, 2023

  • AsyncTask is active whether editor is playing state or not
  • destroyCoreClient makes blocking rust runtime to stop
  • AsyncTask wake up, if _coreClient is NULL, then stop AsyncTask , and return

@leejw51crypto leejw51crypto marked this pull request as draft December 29, 2023 09:11
@leejw51crypto
Copy link
Collaborator Author

leejw51crypto commented Dec 29, 2023

adding more protection for garbage collection
AsyncTask doesn't check reference counting, so should check this validty , if this is used inside AsyncTask

@leejw51crypto leejw51crypto marked this pull request as ready for review December 29, 2023 13:41
@leejw51crypto
Copy link
Collaborator Author

check validity of this using TWeakObjectPtr

@leejw51crypto leejw51crypto force-pushed the feature/346 branch 2 times, most recently from d09387c to 551e9fb Compare December 30, 2023 06:22
@leejw51crypto
Copy link
Collaborator Author

default polling time can be small value such as 10 milli-seconds, and wait in unreal engine blueprint Delay

@leejw51crypto leejw51crypto force-pushed the feature/346 branch 3 times, most recently from f0b663f to 9a4beee Compare January 1, 2024 10:44
fix error in polling

fix crash

add _coreClient check

reformat

use weakthis

fix crash in polling

wait for async task timeout

reduce default polling time

wait at least polling time

remove automatic polling

changelog update
Copy link

@rarcifa rarcifa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left one comment

AsyncTask(ENamedThreads::AnyHiPriThreadNormalTask, [Out, coreclient,
address, chain_id, info,
this]() {
WeakThis]() {
if (!WeakThis.IsValid()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is evoked multiple times. Maybe we can create a helper funtion. Something like

Example

handleIfValid(weakThis, [](auto obj) {
    // Code that requires a valid object
    obj->someMethod();
});

And then just invoke that function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i'll check

@leejw51crypto leejw51crypto added this pull request to the merge queue Jan 3, 2024
Merged via the queue into main with commit a72f959 Jan 3, 2024
8 checks passed
@leejw51crypto leejw51crypto deleted the feature/346 branch April 26, 2024 03:17
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

Successfully merging this pull request may close these issues.

2 participants