In this paper, we use high-resolution smoothed particle hydrodynamics(SPH) simulations to investigate the response of a marginally stable self-gravitating protostellar disc to a close parabolic encounter with a companion discless star. Our main aim is to test whether close brown dwarfs or massive planets can form out of the fragmentation of such discs. We follow the thermal evolution of the disc by including the effects of heating due to compression and shocks and a simple prescription for cooling and find results that contrast with previous isothermal simulations. In the present case we find that fragmentation is inhibited by the interaction, due to the strong effect of tidal heating, which results in a strong stabilization of the disc. A similar behaviour was also previously observed in other simulations involving discs in binary systems. As in the case of isolated discs, it appears that the condition for fragmentation ultimately depends on the cooling rate.