when you dispose of an activity its suspended passive losses for which you are at-risk are deductible. gain or loss can also arise if there is a difference between the proceeds and your tax basis in the venture.
an example which may be oversimplified because we don't know all the details of that activity
say you put in $50K
no money out
net losses $30K -all suspended
leaves a tax basis of $20
sell for $30K
the $30K of losses is released and you have $10K of
gain (depreciation recapture would come first and that could be IRC 1245/1250 or a combination)
your net is $20K which is simply the $50K you put in less the $30K you got out